fixed tests for local packer
This commit is contained in:
@ -14,6 +14,6 @@ export class LocalPacker extends Packer {
|
||||
pack(path: string): void {
|
||||
this.stream = fs.createWriteStream(path);
|
||||
super.pack(this.stream);
|
||||
this.stream.close();
|
||||
//this.stream.close();
|
||||
}
|
||||
}
|
@ -28,11 +28,11 @@ export abstract class Packer {
|
||||
|
||||
if (!style) {
|
||||
let stylesFactory = new DefaultStylesFactory();
|
||||
style = stylesFactory.newInstance();
|
||||
this.style = stylesFactory.newInstance();
|
||||
}
|
||||
|
||||
if (!properties) {
|
||||
properties = new Properties({
|
||||
this.properties = new Properties({
|
||||
creator: "Shan Fu",
|
||||
revision: "1",
|
||||
lastModifiedBy: "Shan Fu"
|
||||
@ -40,7 +40,7 @@ export abstract class Packer {
|
||||
}
|
||||
|
||||
if (!numbering) {
|
||||
numbering = new Numbering();
|
||||
this.numbering = new Numbering();
|
||||
}
|
||||
|
||||
this.archive.on("error", (err) => {
|
||||
|
@ -30,7 +30,6 @@ describe("Packer", () => {
|
||||
});
|
||||
stylesFactory = new DefaultStylesFactory();
|
||||
packer = new LocalPacker(document, stylesFactory.newInstance(), properties);
|
||||
// packer = new LocalPacker(document, DefaultStyle(), properties, "build/tests/test.docx");
|
||||
});
|
||||
|
||||
describe("#pack()", () => {
|
||||
|
Reference in New Issue
Block a user