aboutsummaryrefslogtreecommitdiff
path: root/test/mammoth.tests.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2025-09-10 15:55:27 +0100
committerMichael Williamson <mike@zwobble.org>2025-09-10 15:55:27 +0100
commit1494d3c3a6283a00701ac452b8a9a5f8f2f4e9dd (patch)
tree4e4467490b883fe075094a25ba28f05e62d21393 /test/mammoth.tests.js
parent162324eb530d781aa59acce597997646ee59d1eb (diff)
Support disabling external file access
Diffstat (limited to 'test/mammoth.tests.js')
-rw-r--r--test/mammoth.tests.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/mammoth.tests.js b/test/mammoth.tests.js
index 93a4f16..06cf62f 100644
--- a/test/mammoth.tests.js
+++ b/test/mammoth.tests.js
@@ -327,6 +327,15 @@ test('error if images stored outside of document are specified when passing file
});
});
+test('error if images stored outside of document are specified when external file access is disabled', function() {
+ var docxPath = path.join(__dirname, "test-data/external-picture.docx");
+ return mammoth.convertToHtml({path: docxPath}, {externalFileAccess: false}).then(function(result) {
+ assert.equal(result.value, '');
+ assert.equal(result.messages[0].message, "could not read external image 'tiny-picture.png', external file access is disabled");
+ assert.equal(result.messages[0].type, "error");
+ });
+});
+
test('simple list is converted to list elements', function() {
var docxPath = path.join(__dirname, "test-data/simple-list.docx");
return mammoth.convertToHtml({path: docxPath}).then(function(result) {