diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-07-07 22:17:34 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-07-07 22:17:34 +0100 |
| commit | a080fc59a3fca08bdc6e23a2eeae440f5c7047b3 (patch) | |
| tree | 3d56033c294c617eb7de6b693750efb70a81dd4f /test/docx/docx-reader.tests.js | |
| parent | 28a0e40b645c051d91626ca90959e847b061c8da (diff) | |
Use exports for all tests
Diffstat (limited to 'test/docx/docx-reader.tests.js')
| -rw-r--r-- | test/docx/docx-reader.tests.js | 54 |
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); }); }); |
