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/docx | |
| parent | 20406f3b17d2bb188b78c22602b79684086798d1 (diff) | |
Continue with warning when failing to read image
Diffstat (limited to 'tests/docx')
| -rw-r--r-- | tests/docx/files.tests.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/docx/files.tests.js b/tests/docx/files.tests.js index e37df6b..a00b60b 100644 --- a/tests/docx/files.tests.js +++ b/tests/docx/files.tests.js @@ -32,8 +32,21 @@ describe("Files", function() { }); }); }); + + test("given base is not set when opening relative uri then error is raised", function() { + var files = new Files(null); + return assertError(files.read("not-a-real-file.png", "base64"), function(err) { + assert.equal(err.message, "could not find external image 'not-a-real-file.png', path of input document is unknown"); + }); + }); }); +function assertError(promise, func) { + return promise.then(function() { + assert(false, "Expected error"); + }, func); +} + describe("uriToPath", function() { test("leading slash is retained on non-Windows file URIs", function() { |
