diff options
| -rw-r--r-- | tests/docx/files.tests.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/docx/files.tests.js b/tests/docx/files.tests.js index 65cd486..9f5bb38 100644 --- a/tests/docx/files.tests.js +++ b/tests/docx/files.tests.js @@ -43,7 +43,7 @@ describe("Files", function() { 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'"); + assertRegex(err.message, /could not open external image: 'not-a-real-file.png' \(document directory: '\/tmp'\)\nENOENT,.*'\/tmp\/not-a-real-file.png'.*/); }); }); }); @@ -54,6 +54,10 @@ function assertError(promise, func) { }, func); } +function assertRegex(actual, expected) { + assert.ok(expected.test(actual), "Expected regex: " + expected + "\nbut was: " + actual); +} + describe("uriToPath", function() { test("leading slash is retained on non-Windows file URIs", function() { |
