Skip to content

Commit

Permalink
Add test for strict format
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilliamson committed Feb 18, 2024
1 parent c94c56d commit c2c6dd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/mammoth.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<p>Test</p>");
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");
Expand Down
Binary file added test/test-data/strict-format.docx
Binary file not shown.

0 comments on commit c2c6dd1

Please sign in to comment.