diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-04-18 20:12:51 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-04-18 20:12:51 +0100 |
| commit | f5e1cbb69b1aae679f8629fe13d0c49778b181d0 (patch) | |
| tree | 97e918bcec20cabb94f050a924578c0f2ea582d0 /tests | |
| parent | 554e939ed6f3ce697fca925a333cb9fc14ccbe5a (diff) | |
Emit warnings if paragraph style is not recognised
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/document-to-html.tests.js | 10 | ||||
| -rw-r--r-- | tests/mammoth.tests.js | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js index f1e6402..d63813d 100644 --- a/tests/document-to-html.tests.js +++ b/tests/document-to-html.tests.js @@ -85,6 +85,16 @@ describe('DocumentConverter', function() { }); }); + test('warning is emitted if style is unrecognised', function() { + var document = new documents.Document([ + paragraphOfText("Hello.", "Heading1"), + ]); + var converter = new DocumentConverter(); + return converter.convertToHtml(document).then(function(result) { + assert.deepEqual(result.messages, [results.warning("Unrecognised paragraph style: Heading1")]); + }); + }); + test('can use stacked styles to generate nested HTML elements', function() { var document = new documents.Document([ paragraphOfText("Hello.", "Heading1") diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js index 49bc02f..d8235ff 100644 --- a/tests/mammoth.tests.js +++ b/tests/mammoth.tests.js @@ -18,7 +18,8 @@ describe('mammoth', function() { var docxPath = path.join(__dirname, "test-data/single-paragraph.docx"); var converter = new mammoth.Converter(); return converter.convertToHtml({path: docxPath}).then(function(result) { - assert.equal("<p>Walking on imported air</p>", result.value); + assert.equal(result.value, "<p>Walking on imported air</p>"); + assert.deepEqual(result.messages, []); }); }); |
