var assert = require("assert"); var path = require("path"); var fs = require("fs"); var q = require("q"); var mammoth = require("../") var htmlPaths = require("../lib/html-paths"); var documentMatchers = require("../lib/document-matchers"); var testing = require("./testing"); var test = testing.test; var testData = testing.testData; var createFakeDocxFile = testing.createFakeDocxFile; describe('mammoth', function() { test('should convert docx containing one paragraph to single p element', function() { var docxPath = path.join(__dirname, "test-data/single-paragraph.docx"); return mammoth.convertToHtml({path: docxPath}).then(function(result) { assert.equal(result.value, "
Walking on imported air
"); assert.deepEqual(result.messages, []); }); }); test('options are passed to document converter when creating Converter', function() { var docxFile = createFakeDocxFile({ "word/document.xml": testData("simple/word/document.xml") }); var options = { styleMap: "p => h1" }; return mammoth.convertToHtml({file: docxFile}, options).then(function(result) { assert.equal("