aboutsummaryrefslogtreecommitdiff
path: root/test/mammoth.tests.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-11-13 12:14:39 +0000
committerMichael Williamson <mike@zwobble.org>2016-11-13 12:14:39 +0000
commita50b0bf683fa87fc8927c66a9f0f2ccea3290067 (patch)
treef06bf5383595bea76dfa4cb03e4e81068cf3ac31 /test/mammoth.tests.js
parent10615b1ae0a5c5b12a6d7bd907ec00e5b442539f (diff)
Add test with pre-created embedded style map
Diffstat (limited to 'test/mammoth.tests.js')
-rw-r--r--test/mammoth.tests.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/mammoth.tests.js b/test/mammoth.tests.js
index 73e6a0f..c110f46 100644
--- a/test/mammoth.tests.js
+++ b/test/mammoth.tests.js
@@ -82,6 +82,14 @@ test('style map can be expressed as array of style mappings', function() {
});
test('embedded style map is used if present', function() {
+ var docxPath = path.join(__dirname, "test-data/embedded-style-map.docx");
+ return mammoth.convertToHtml({path: docxPath}).then(function(result) {
+ assert.equal(result.value, "<h1>Walking on imported air</h1>");
+ assert.deepEqual(result.messages, []);
+ });
+});
+
+test('embedded style map can be written and then read', function() {
var docxPath = path.join(__dirname, "test-data/single-paragraph.docx");
return promises.nfcall(fs.readFile, docxPath)
.then(function(buffer) {