aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-04-11 20:12:04 +0100
committerMichael Williamson <mike@zwobble.org>2013-04-11 20:12:04 +0100
commitc57b900666a82b4ccce033a923e53906255078c0 (patch)
treec8619bf48c3bca17ea3c429194b96c0b3937e16b /tests
parent57622e1584e7367aa41d4a09f8db33c703a6a0df (diff)
Don't guess what the input for conversion is
Diffstat (limited to 'tests')
-rw-r--r--tests/docx-reader.tests.js4
-rw-r--r--tests/mammoth.tests.js6
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/docx-reader.tests.js b/tests/docx-reader.tests.js
index 58c5f6b..4fc487f 100644
--- a/tests/docx-reader.tests.js
+++ b/tests/docx-reader.tests.js
@@ -22,7 +22,7 @@ describe("docx-reader", function() {
var docxFile = createFakeDocxFile({
"word/document.xml": testData("simple/word/document.xml")
});
- return docxReader.read(docxFile).then(function(result) {
+ return docxReader.read({file: docxFile}).then(function(result) {
assert.deepEqual(expectedDocument, result.document);
});
});
@@ -32,7 +32,7 @@ describe("docx-reader", function() {
"word/document.xml": testData("hyperlinks/word/document.xml"),
"word/_rels/document.xml.rels": testData("hyperlinks/word/_rels/document.xml.rels")
});
- return docxReader.read(docxFile).then(function(result) {
+ return docxReader.read({file: docxFile}).then(function(result) {
var paragraph = result.document.children[0];
assert.equal(1, paragraph.children.length);
var hyperlink = paragraph.children[0];
diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js
index 823a35b..9e81a84 100644
--- a/tests/mammoth.tests.js
+++ b/tests/mammoth.tests.js
@@ -14,7 +14,7 @@ describe('mammoth', function() {
test('should convert docx containing one one paragraph to single p element', function() {
var docxPath = path.join(__dirname, "test-data/single-paragraph.docx");
var converter = new mammoth.Converter();
- return converter.convertToHtml(docxPath).then(function(result) {
+ return converter.convertToHtml({path: docxPath}).then(function(result) {
assert.equal("<p>Walking on imported air</p>", result.html);
});
});
@@ -26,7 +26,7 @@ describe('mammoth', function() {
var converter = new mammoth.Converter({
defaultParagraphStyle: htmlPaths.topLevelElement("h1")
});
- return converter.convertToHtml(docxFile).then(function(result) {
+ return converter.convertToHtml({file: docxFile}).then(function(result) {
assert.equal("<h1>Hello.</h1>", result.html);
});
});
@@ -34,7 +34,7 @@ describe('mammoth', function() {
test('inline images are included in output', function() {
var converter = new mammoth.Converter();
var docxPath = path.join(__dirname, "test-data/tiny-picture.docx");
- return converter.convertToHtml(docxPath).then(function(result) {
+ return converter.convertToHtml({path: docxPath}).then(function(result) {
assert.equal(result.html, '<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAOvgAADr4B6kKxwAAAABNJREFUKFNj/M+ADzDhlWUYqdIAQSwBE8U+X40AAAAASUVORK5CYII=" /></p>');
});
});