From c2c6dd1714bd02f7e516746daf3d22938e6407ee Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 18 Feb 2024 12:54:33 +0000 Subject: Add test for strict format --- test/mammoth.tests.js | 7 +++++++ test/test-data/strict-format.docx | Bin 0 -> 11692 bytes 2 files changed, 7 insertions(+) create mode 100644 test/test-data/strict-format.docx diff --git a/test/mammoth.tests.js b/test/mammoth.tests.js index 3b1726e..93a4f16 100644 --- a/test/mammoth.tests.js +++ b/test/mammoth.tests.js @@ -496,6 +496,13 @@ test('extractRawText can use .docx files represented by a Buffer', function() { }); }); +test('can read strict format', function() { + var docxPath = path.join(__dirname, "test-data/strict-format.docx"); + return mammoth.convertToHtml({path: docxPath}).then(function(result) { + assert.equal(result.value, "

Test

"); + assert.deepEqual(result.messages, []); + }); +}); test('should throw error if file is not a valid docx document', function() { var docxPath = path.join(__dirname, "test-data/empty.zip"); diff --git a/test/test-data/strict-format.docx b/test/test-data/strict-format.docx new file mode 100644 index 0000000..4495720 Binary files /dev/null and b/test/test-data/strict-format.docx differ -- cgit v1.2.3