diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-11-19 14:20:08 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-11-19 14:20:08 +0000 |
| commit | 599b3f17555a9d0c03ff040df6dca232b152a6f0 (patch) | |
| tree | cf1c6c381cd3bd7b2ab874d79b7bb4238a287d45 /test/mammoth.tests.js | |
| parent | 5607cf8f4078601da73d9d4184ecd9a82f96981a (diff) | |
Test that explicit style map takes precedence over embedded style map
Diffstat (limited to 'test/mammoth.tests.js')
| -rw-r--r-- | test/mammoth.tests.js | 11 |
1 files changed, 11 insertions, 0 deletions
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, "<p>Walking on imported air</p>"); + 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) |
