From 599b3f17555a9d0c03ff040df6dca232b152a6f0 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 19 Nov 2016 14:20:08 +0000 Subject: Test that explicit style map takes precedence over embedded style map --- test/mammoth.tests.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/mammoth.tests.js b/test/mammoth.tests.js index c110f46..db2b338 100644 --- a/test/mammoth.tests.js +++ b/test/mammoth.tests.js @@ -89,6 +89,17 @@ test('embedded style map is used if present', function() { }); }); +test('explicit style map takes precedence over embedded style map', function() { + var docxPath = path.join(__dirname, "test-data/embedded-style-map.docx"); + var options = { + styleMap: ["p => p"] + }; + return mammoth.convertToHtml({path: docxPath}, options).then(function(result) { + assert.equal(result.value, "

Walking on imported air

"); + 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) -- cgit v1.2.3