From 4b4ec85bc4f49e72244f7219539124b45b876d8e Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 12 Aug 2015 21:57:45 +0100 Subject: Open zip file before passing to readers --- tests/docx/docx-reader.tests.js | 4 ++-- tests/mammoth.tests.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/docx/docx-reader.tests.js b/tests/docx/docx-reader.tests.js index e8d5511..69ade7e 100644 --- a/tests/docx/docx-reader.tests.js +++ b/tests/docx/docx-reader.tests.js @@ -21,7 +21,7 @@ describe("docx-reader", function() { var docxFile = createFakeDocxFile({ "word/document.xml": testData("simple/word/document.xml") }); - return docxReader.read({file: docxFile}).then(function(result) { + return docxReader.read(docxFile).then(function(result) { assert.deepEqual(expectedDocument, result.value); }); }); @@ -31,7 +31,7 @@ describe("docx-reader", function() { "word/document.xml": testData("hyperlinks/word/document.xml"), "word/_rels/document.xml.rels": testData("hyperlinks/word/_rels/document.xml.rels") }); - return docxReader.read({file: docxFile}).then(function(result) { + return docxReader.read(docxFile).then(function(result) { var paragraph = result.value.children[0]; assert.equal(1, paragraph.children.length); var hyperlink = paragraph.children[0]; diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js index 41a3a22..6fdd60f 100644 --- a/tests/mammoth.tests.js +++ b/tests/mammoth.tests.js @@ -84,7 +84,7 @@ describe('mammoth', function() { var docxPath = path.join(__dirname, "test-data/single-paragraph.docx"); return promises.nfcall(fs.readFile, docxPath) .then(function(buffer) { - return mammoth.writeStyleMapToDocx({buffer: buffer, styleMap: "p => h1"}); + return mammoth.writeStyleMapToDocx({buffer: buffer}, "p => h1"); }) .then(function(docx) { return mammoth.convertToHtml({buffer: docx.toBuffer()}); -- cgit v1.2.3