From 2596c1c7122096874d00d7c5392d4ffb482e31b6 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 7 Sep 2015 20:39:54 +0100 Subject: Continue with warning when failing to read image --- tests/mammoth.tests.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests/mammoth.tests.js') diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js index bb3dca2..10b95ef 100644 --- a/tests/mammoth.tests.js +++ b/tests/mammoth.tests.js @@ -188,7 +188,16 @@ describe('mammoth', function() { var docxPath = path.join(__dirname, "test-data/external-picture.docx"); return mammoth.convertToHtml({path: docxPath}).then(function(result) { assert.equal(result.value, '

'); - assert.deepEqual([], result.messages); + assert.deepEqual(result.messages, []); + }); + }); + + test('warn if images stored outside of document are specified when passing file without path', function() { + var docxPath = path.join(__dirname, "test-data/external-picture.docx"); + var buffer = fs.readFileSync(docxPath); + return mammoth.convertToHtml({buffer: buffer}).then(function(result) { + assert.equal(result.value, ''); + assert.deepEqual(result.messages, [results.warning("could not find external image 'tiny-picture.png', path of input document is unknown")]); }); }); -- cgit v1.2.3