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/notes-reader.tests.js | |
| parent | 28a0e40b645c051d91626ca90959e847b061c8da (diff) | |
Use exports for all tests
Diffstat (limited to 'test/docx/notes-reader.tests.js')
| -rw-r--r-- | test/docx/notes-reader.tests.js | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/test/docx/notes-reader.tests.js b/test/docx/notes-reader.tests.js index 85a49f5..1d4cf9c 100644 --- a/test/docx/notes-reader.tests.js +++ b/test/docx/notes-reader.tests.js @@ -4,36 +4,32 @@ var createFootnotesReader = require("../../lib/docx/notes-reader").createFootnot var BodyReader = require("../../lib/docx/body-reader").BodyReader; var documents = require("../../lib/documents"); var XmlElement = require("../../lib/xml").Element; -var test = require("../testing").test; +var test = require("../test")(module); -describe('readFootnotesXml', function() { - test('ID and body of footnote are read', function() { - var bodyReader = new BodyReader({}); - var footnoteBody = [new XmlElement("w:p", {}, [])]; - var footnotes = createFootnotesReader(bodyReader)( - new XmlElement("w:footnotes", {}, [ - new XmlElement("w:footnote", {"w:id": "1"}, footnoteBody) - ]) - ); - assert.equal(footnotes.value.length, 1); - assert.deepEqual(footnotes.value[0].body, [new documents.Paragraph([])]); - assert.deepEqual(footnotes.value[0].noteId, "1"); - }); +test('ID and body of footnote are read', function() { + var bodyReader = new BodyReader({}); + var footnoteBody = [new XmlElement("w:p", {}, [])]; + var footnotes = createFootnotesReader(bodyReader)( + new XmlElement("w:footnotes", {}, [ + new XmlElement("w:footnote", {"w:id": "1"}, footnoteBody) + ]) + ); + assert.equal(footnotes.value.length, 1); + assert.deepEqual(footnotes.value[0].body, [new documents.Paragraph([])]); + assert.deepEqual(footnotes.value[0].noteId, "1"); }); footnoteTypeIsIgnored('continuationSeparator'); footnoteTypeIsIgnored('separator'); function footnoteTypeIsIgnored(type) { - describe('footnotes of type ' + type + ' are ignored', function() { - test('ID and body of footnote are read', function() { - var footnotes = createFootnotesReader()( - new XmlElement("w:footnotes", {}, [ - new XmlElement("w:footnote", {"w:id": "1", "w:type": type}, []) - ]) - ); - assert.equal(footnotes.value.length, 0); - }); + test('footnotes of type ' + type + ' are ignored', function() { + var footnotes = createFootnotesReader()( + new XmlElement("w:footnotes", {}, [ + new XmlElement("w:footnote", {"w:id": "1", "w:type": type}, []) + ]) + ); + assert.equal(footnotes.value.length, 0); }); } |
