diff options
| -rw-r--r-- | lib/options-reader.js | 3 | ||||
| -rw-r--r-- | tests/options-reader.tests.js | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/options-reader.js b/lib/options-reader.js index caf4fe5..3cac969 100644 --- a/lib/options-reader.js +++ b/lib/options-reader.js @@ -1,11 +1,12 @@ exports.readOptions = readOptions; + var extend = require("xtend"); var _ = require("underscore"); var style = require("./style-reader").readStyle; -var standardOptions = { +var standardOptions = exports._standardOptions = { styleMap: [ style("p.Heading1 => h1:fresh"), style("p.Heading2 => h2:fresh"), diff --git a/tests/options-reader.tests.js b/tests/options-reader.tests.js new file mode 100644 index 0000000..d493ae6 --- /dev/null +++ b/tests/options-reader.tests.js @@ -0,0 +1,16 @@ +var assert = require("assert"); + +var optionsReader = require("../lib/options-reader"); +var standardOptions = optionsReader._standardOptions; +var readOptions = optionsReader.readOptions; + + +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({})); + }); +}); |
