diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-09-07 20:39:54 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-09-07 20:39:54 +0100 |
| commit | 2596c1c7122096874d00d7c5392d4ffb482e31b6 (patch) | |
| tree | 9eea4c367538cc5b7c0554e7f7d3299dc82d166d /tests/mammoth.tests.js | |
| parent | 20406f3b17d2bb188b78c22602b79684086798d1 (diff) | |
Continue with warning when failing to read image
Diffstat (limited to 'tests/mammoth.tests.js')
| -rw-r--r-- | tests/mammoth.tests.js | 11 |
1 files changed, 10 insertions, 1 deletions
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, '<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAOvgAADr4B6kKxwAAAABNJREFUKFNj/M+ADzDhlWUYqdIAQSwBE8U+X40AAAAASUVORK5CYII=" /></p>'); - 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")]); }); }); |
