aboutsummaryrefslogtreecommitdiff
path: root/tests/docx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/docx')
-rw-r--r--tests/docx/files.tests.js13
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() {