aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-05-06 13:41:20 +0100
committerMichael Williamson <mike@zwobble.org>2013-05-06 13:41:20 +0100
commit4ef34968c720c58c419ee18f0897645049175d7c (patch)
tree88001251a8af6c5f92673a9d64af5742adb9c774 /tests
parentb28c1b2fb503e6bd2120c9c665084eb1bbecef32 (diff)
Add mammoth.convertToHtml
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");