From c704db065348c2b632a408c8ad87f8ee50d2bcef Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Mon, 4 Jul 2016 19:01:30 +0100 Subject: [PATCH] fixed tests for local packer --- ts/export/packer/local.ts | 2 +- ts/export/packer/packer.ts | 6 +++--- ts/tests/export/localPackerTest.ts | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ts/export/packer/local.ts b/ts/export/packer/local.ts index afdf1c5255..5124a0ac39 100644 --- a/ts/export/packer/local.ts +++ b/ts/export/packer/local.ts @@ -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(); } } \ No newline at end of file diff --git a/ts/export/packer/packer.ts b/ts/export/packer/packer.ts index 7bf7f57526..e4206461d2 100644 --- a/ts/export/packer/packer.ts +++ b/ts/export/packer/packer.ts @@ -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) => { diff --git a/ts/tests/export/localPackerTest.ts b/ts/tests/export/localPackerTest.ts index 527a5f0af8..c15a717969 100644 --- a/ts/tests/export/localPackerTest.ts +++ b/ts/tests/export/localPackerTest.ts @@ -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()", () => {