From 53e9f9200a781e488830c3c01ff58f50d667a812 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 6 Jan 2014 22:42:12 +0000 Subject: Allow style map to be an array of styles --- tests/mammoth.tests.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js index 67b95f3..f0d87c8 100644 --- a/tests/mammoth.tests.js +++ b/tests/mammoth.tests.js @@ -23,7 +23,7 @@ describe('mammoth', function() { }); }); - test('options are passed to document converter when creating Converter', function() { + test('style map can be expressed as string', function() { var docxFile = createFakeDocxFile({ "word/document.xml": testData("simple/word/document.xml") }); @@ -35,6 +35,18 @@ describe('mammoth', function() { }); }); + test('style map can be expressed as array of styles', function() { + var docxFile = createFakeDocxFile({ + "word/document.xml": testData("simple/word/document.xml") + }); + var options = { + styleMap: [mammoth.style("p => h1")] + }; + return mammoth.convertToHtml({file: docxFile}, options).then(function(result) { + assert.equal("

Hello.

", result.value); + }); + }); + test('options are passed to document converter when calling mammoth.convertToHtml', function() { var docxFile = createFakeDocxFile({ "word/document.xml": testData("simple/word/document.xml") -- cgit v1.2.3