diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-06-28 20:58:49 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-06-28 20:58:49 +0100 |
| commit | d046c4297a04b6eecadf01093382b72bb1b71032 (patch) | |
| tree | d90fc8dde051f2dba93c41f77506f472269124ba /tests | |
| parent | f557dc7de5fd0dff3a08808e7c4d9736970e6349 (diff) | |
Replace jshint with eslint
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/.eslintrc.json | 7 | ||||
| -rw-r--r-- | tests/document-to-html.tests.js | 6 | ||||
| -rw-r--r-- | tests/docx/body-reader.tests.js | 4 | ||||
| -rw-r--r-- | tests/docx/styles-reader.tests.js | 2 | ||||
| -rw-r--r-- | tests/main.tests.js | 2 | ||||
| -rw-r--r-- | tests/writers/markdown-writer.tests.js | 8 |
6 files changed, 18 insertions, 11 deletions
diff --git a/tests/.eslintrc.json b/tests/.eslintrc.json new file mode 100644 index 0000000..4869f03 --- /dev/null +++ b/tests/.eslintrc.json @@ -0,0 +1,7 @@ +{ + "globals": { + "__dirname": false, + "describe": false, + "it": false + } +} diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js index ea0056f..10ea265 100644 --- a/tests/document-to-html.tests.js +++ b/tests/document-to-html.tests.js @@ -63,7 +63,7 @@ describe('DocumentConverter', function() { test('uses style mappings to pick HTML element for docx paragraph', function() { var document = new documents.Document([ - paragraphOfText("Hello.", "Heading1", "Heading 1"), + paragraphOfText("Hello.", "Heading1", "Heading 1") ]); var converter = new DocumentConverter({ styleMap: [ @@ -80,7 +80,7 @@ describe('DocumentConverter', function() { test('mappings for style names are case insensitive', function() { var document = new documents.Document([ - paragraphOfText("Hello.", "Heading1", "heading 1"), + paragraphOfText("Hello.", "Heading1", "heading 1") ]); var converter = new DocumentConverter({ styleMap: [ @@ -114,7 +114,7 @@ describe('DocumentConverter', function() { test('warning is emitted if paragraph style is unrecognised', function() { var document = new documents.Document([ - paragraphOfText("Hello.", "Heading1", "Heading 1"), + paragraphOfText("Hello.", "Heading1", "Heading 1") ]); var converter = new DocumentConverter(); return converter.convertToHtml(document).then(function(result) { diff --git a/tests/docx/body-reader.tests.js b/tests/docx/body-reader.tests.js index 4a54aeb..0a808b0 100644 --- a/tests/docx/body-reader.tests.js +++ b/tests/docx/body-reader.tests.js @@ -303,7 +303,7 @@ describe("readXmlElement: ", function() { test("w:vMerge without val is treated as continue", function() { var tableXml = new XmlElement("w:tbl", {}, [ row(emptyCell(vMerge("restart"))), - row(emptyCell(vMerge())), + row(emptyCell(vMerge())) ]); var result = readXmlElement(tableXml); assert.deepEqual(result.value, new documents.Table([ @@ -336,7 +336,7 @@ describe("readXmlElement: ", function() { var result = readXmlElement(tableXml); assert.deepEqual(result.value, new documents.Table([ docRow([docEmptyCell({colSpan: 2})]), - docRow([docEmptyCell(), docEmptyCell()]), + docRow([docEmptyCell(), docEmptyCell()]) ])); }); diff --git a/tests/docx/styles-reader.tests.js b/tests/docx/styles-reader.tests.js index 2bdda33..4ff19c7 100644 --- a/tests/docx/styles-reader.tests.js +++ b/tests/docx/styles-reader.tests.js @@ -45,7 +45,7 @@ describe('readStylesXml', function() { test('character and table styles are distinct', function() { var styles = readStylesXml({ root: new XmlElement("w:styles", {}, [ - styleElement("table", "Heading1", "Heading 1"), + styleElement("table", "Heading1", "Heading 1") ]) }); assert.equal(styles.findCharacterStyleById("Heading1"), null); diff --git a/tests/main.tests.js b/tests/main.tests.js index 8041fbd..5b54441 100644 --- a/tests/main.tests.js +++ b/tests/main.tests.js @@ -78,7 +78,7 @@ function runMammoth() { // TODO: proper escaping of args var command = processArgs.join(" "); child_process.exec(command, function(error, stdout, stderr) { - console.log(stderr); + console.log(stderr); // eslint-disable-line no-console assert.equal(error, null); deferred.resolve({output: stdout, stderrOutput: stderr}); }); diff --git a/tests/writers/markdown-writer.tests.js b/tests/writers/markdown-writer.tests.js index 8d05ff6..38d2afe 100644 --- a/tests/writers/markdown-writer.tests.js +++ b/tests/writers/markdown-writer.tests.js @@ -69,7 +69,7 @@ describe('markdown-writer', function() { test('anchor tags are written as hyperlinks', function() { var writer = mdWriter.writer(); - writer.open("a", { "href": "http://example.com" }); + writer.open("a", {"href": "http://example.com"}); writer.text("Hello"); writer.close("a"); return assert.equal(writer.asString(), "[Hello](http://example.com)"); @@ -101,19 +101,19 @@ describe('markdown-writer', function() { test('can generate images', function() { var writer = mdWriter.writer(); - writer.selfClosing("img", { "src": "http://example.com/image.jpg", "alt": "Alt Text" }); + writer.selfClosing("img", {"src": "http://example.com/image.jpg", "alt": "Alt Text"}); return assert.equal(writer.asString(), ""); }); test('can generate images with missing alt attribute', function() { var writer = mdWriter.writer(); - writer.selfClosing("img", { "src": "http://example.com/image.jpg" }); + writer.selfClosing("img", {"src": "http://example.com/image.jpg"}); return assert.equal(writer.asString(), ""); }); test('can generate images with missing src attribute', function() { var writer = mdWriter.writer(); - writer.selfClosing("img", { "alt": "Alt Text" }); + writer.selfClosing("img", {"alt": "Alt Text"}); return assert.equal(writer.asString(), "![Alt Text]()"); }); |
