aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/mammoth.tests.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js
index 01afdb9..6f348c2 100644
--- a/tests/mammoth.tests.js
+++ b/tests/mammoth.tests.js
@@ -38,7 +38,7 @@ describe('mammoth', function() {
});
});
- test('options are passed to document converter', function() {
+ test('options are passed to document converter when creating Converter', function() {
var docxFile = createFakeDocxFile({
"word/document.xml": testData("simple/word/document.xml")
});
@@ -50,6 +50,18 @@ describe('mammoth', function() {
});
});
+ test('options are passed to document converter when calling mammoth.convertToHtml', function() {
+ var docxFile = createFakeDocxFile({
+ "word/document.xml": testData("simple/word/document.xml")
+ });
+ var options = {
+ defaultParagraphStyle: htmlPaths.topLevelElement("h1")
+ };
+ return mammoth.convertToHtml({file: docxFile}, options).then(function(result) {
+ assert.equal("<h1>Hello.</h1>", result.value);
+ });
+ });
+
test('inline images are included in output', function() {
var converter = new mammoth.Converter();
var docxPath = path.join(__dirname, "test-data/tiny-picture.docx");