aboutsummaryrefslogtreecommitdiff
path: root/test/docx/docx-reader.tests.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-07-07 22:17:34 +0100
committerMichael Williamson <mike@zwobble.org>2016-07-07 22:17:34 +0100
commita080fc59a3fca08bdc6e23a2eeae440f5c7047b3 (patch)
tree3d56033c294c617eb7de6b693750efb70a81dd4f /test/docx/docx-reader.tests.js
parent28a0e40b645c051d91626ca90959e847b061c8da (diff)
Use exports for all tests
Diffstat (limited to 'test/docx/docx-reader.tests.js')
-rw-r--r--test/docx/docx-reader.tests.js54
1 files changed, 26 insertions, 28 deletions
diff --git a/test/docx/docx-reader.tests.js b/test/docx/docx-reader.tests.js
index 69ade7e..283d03a 100644
--- a/test/docx/docx-reader.tests.js
+++ b/test/docx/docx-reader.tests.js
@@ -4,39 +4,37 @@ var docxReader = require("../../lib/docx/docx-reader");
var documents = require("../../lib/documents");
var testing = require("../testing");
-var test = testing.test;
+var test = require("../test")(module);
var testData = testing.testData;
var createFakeDocxFile = testing.createFakeDocxFile;
-describe("docx-reader", function() {
- test("can read document with single paragraph with single run of text", function() {
- var expectedDocument = documents.Document([
- documents.Paragraph([
- documents.Run([
- documents.Text("Hello.")
- ])
+test("can read document with single paragraph with single run of text", function() {
+ var expectedDocument = documents.Document([
+ documents.Paragraph([
+ documents.Run([
+ documents.Text("Hello.")
])
- ]);
- var docxFile = createFakeDocxFile({
- "word/document.xml": testData("simple/word/document.xml")
- });
- return docxReader.read(docxFile).then(function(result) {
- assert.deepEqual(expectedDocument, result.value);
- });
+ ])
+ ]);
+ var docxFile = createFakeDocxFile({
+ "word/document.xml": testData("simple/word/document.xml")
});
-
- test("hyperlink hrefs are read from relationships file", function() {
- var docxFile = createFakeDocxFile({
- "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) {
- var paragraph = result.value.children[0];
- assert.equal(1, paragraph.children.length);
- var hyperlink = paragraph.children[0];
- assert.equal(hyperlink.href, "http://www.example.com");
- assert.equal(hyperlink.children.length, 1);
- });
+ return docxReader.read(docxFile).then(function(result) {
+ assert.deepEqual(expectedDocument, result.value);
+ });
+});
+
+test("hyperlink hrefs are read from relationships file", function() {
+ var docxFile = createFakeDocxFile({
+ "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) {
+ var paragraph = result.value.children[0];
+ assert.equal(1, paragraph.children.length);
+ var hyperlink = paragraph.children[0];
+ assert.equal(hyperlink.href, "http://www.example.com");
+ assert.equal(hyperlink.children.length, 1);
});
});