diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-09-07 20:46:10 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-09-07 20:46:10 +0100 |
| commit | e479598b2e31d4963a3501e2f383af82dada296f (patch) | |
| tree | 57205c2d7dfeaedea6392ad996d399fd82d7a5c3 /tests | |
| parent | 2596c1c7122096874d00d7c5392d4ffb482e31b6 (diff) | |
Provide slightly more description error on file open failure
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/docx/files.tests.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/docx/files.tests.js b/tests/docx/files.tests.js index a00b60b..65cd486 100644 --- a/tests/docx/files.tests.js +++ b/tests/docx/files.tests.js @@ -39,6 +39,13 @@ describe("Files", function() { assert.equal(err.message, "could not find external image 'not-a-real-file.png', path of input document is unknown"); }); }); + + test("error if relative uri cannot be opened", function() { + var files = new Files("/tmp"); + return assertError(files.read("not-a-real-file.png", "base64"), function(err) { + assert.equal(err.message, "could not open external image: 'not-a-real-file.png' (document directory: '/tmp')\nENOENT, open '/tmp/not-a-real-file.png'"); + }); + }); }); function assertError(promise, func) { |
