diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-08-28 19:55:24 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-08-28 19:55:38 +0100 |
| commit | b1ae23f544c479d2b71347bbf67df7baac40d78f (patch) | |
| tree | 383e694dae42ba544f690c3b0ab388a7931c0793 /test/options-reader.tests.js | |
| parent | 7dba15069f9a606b9e248d7e4cd024ddaa6ac3e3 (diff) | |
| parent | c42714e5f4b643de27b106a084601e39b7e5d04c (diff) | |
Merge branch 'master' into image-errors
Conflicts:
test/mammoth.tests.js
Diffstat (limited to 'test/options-reader.tests.js')
| -rw-r--r-- | test/options-reader.tests.js | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/test/options-reader.tests.js b/test/options-reader.tests.js index 94c864c..06e0764 100644 --- a/test/options-reader.tests.js +++ b/test/options-reader.tests.js @@ -3,46 +3,45 @@ var assert = require("assert"); var optionsReader = require("../lib/options-reader"); var standardOptions = optionsReader._standardOptions; var readOptions = optionsReader.readOptions; +var test = require("./test")(module); -describe('readOptions', function() { - it('standard options are used if options is undefined', function() { - assert.deepEqual(standardOptions, readOptions(undefined)); - }); - - it('standard options are used if options is empty', function() { - assert.deepEqual(standardOptions, readOptions({})); - }); - - it('custom style map as string is prepended to standard style map', function() { - var options = readOptions({ - styleMap: "p.SectionTitle => h2" - }); - assert.deepEqual("p.SectionTitle => h2", options.styleMap[0]); - assert.deepEqual(standardOptions.styleMap, options.styleMap.slice(1)); +test('standard options are used if options is undefined', function() { + assert.deepEqual(standardOptions, readOptions(undefined)); +}); + +test('standard options are used if options is empty', function() { + assert.deepEqual(standardOptions, readOptions({})); +}); + +test('custom style map as string is prepended to standard style map', function() { + var options = readOptions({ + styleMap: "p.SectionTitle => h2" }); - - it('custom style map as array is prepended to standard style map', function() { - var options = readOptions({ - styleMap: ["p.SectionTitle => h2"] - }); - assert.deepEqual("p.SectionTitle => h2", options.styleMap[0]); - assert.deepEqual(standardOptions.styleMap, options.styleMap.slice(1)); + assert.deepEqual("p.SectionTitle => h2", options.styleMap[0]); + assert.deepEqual(standardOptions.styleMap, options.styleMap.slice(1)); +}); + +test('custom style map as array is prepended to standard style map', function() { + var options = readOptions({ + styleMap: ["p.SectionTitle => h2"] }); - - it('lines starting with # in custom style map are ignored', function() { - var options = readOptions({ - styleMap: "# p.SectionTitle => h3\np.SectionTitle => h2" - }); - assert.deepEqual("p.SectionTitle => h2", options.styleMap[0]); - assert.deepEqual(standardOptions.styleMap, options.styleMap.slice(1)); + assert.deepEqual("p.SectionTitle => h2", options.styleMap[0]); + assert.deepEqual(standardOptions.styleMap, options.styleMap.slice(1)); +}); + +test('lines starting with # in custom style map are ignored', function() { + var options = readOptions({ + styleMap: "# p.SectionTitle => h3\np.SectionTitle => h2" }); - - it('default style mappings are ignored if includeDefaultStyleMap is false', function() { - var options = readOptions({ - styleMap: "p.SectionTitle => h2", - includeDefaultStyleMap: false - }); - assert.deepEqual(["p.SectionTitle => h2"], options.styleMap); + assert.deepEqual("p.SectionTitle => h2", options.styleMap[0]); + assert.deepEqual(standardOptions.styleMap, options.styleMap.slice(1)); +}); + +test('default style mappings are ignored if includeDefaultStyleMap is false', function() { + var options = readOptions({ + styleMap: "p.SectionTitle => h2", + includeDefaultStyleMap: false }); + assert.deepEqual(["p.SectionTitle => h2"], options.styleMap); }); |
