Add tests and clean up code
This commit is contained in:
@ -1,13 +0,0 @@
|
||||
import { ImageParagraph, PictureRun } from "../paragraph";
|
||||
|
||||
export class Image {
|
||||
constructor(private readonly paragraph: ImageParagraph) {}
|
||||
|
||||
public get Paragraph(): ImageParagraph {
|
||||
return this.paragraph;
|
||||
}
|
||||
|
||||
public get Run(): PictureRun {
|
||||
return this.paragraph.Run;
|
||||
}
|
||||
}
|
@ -1,3 +1,2 @@
|
||||
export * from "./media";
|
||||
export * from "./data";
|
||||
export * from "./image";
|
||||
|
@ -80,6 +80,16 @@ describe("Media", () => {
|
||||
const image = new Media().addMedia("");
|
||||
expect(image.stream).to.be.an.instanceof(Uint8Array);
|
||||
});
|
||||
|
||||
it("should use data as is if its not a string", () => {
|
||||
// tslint:disable-next-line
|
||||
((process as any).atob as any) = () => "atob result";
|
||||
// tslint:disable-next-line:no-any
|
||||
(Media as any).generateId = () => "test";
|
||||
|
||||
const image = new Media().addMedia(new Buffer(""));
|
||||
expect(image.stream).to.be.an.instanceof(Uint8Array);
|
||||
});
|
||||
});
|
||||
|
||||
describe("#getMedia", () => {
|
||||
|
Reference in New Issue
Block a user