diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-01-07 22:18:23 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-01-07 22:18:23 +0000 |
| commit | bc6e9ac4ee638fdc11019c979e3f03b9d7098e3f (patch) | |
| tree | 3ecd67fd79a2dc16566723dcdaa22877c05bac1e | |
| parent | b0bc37e59cb521890be25015a66a1ae5d4f5c6f7 (diff) | |
Add some very basic tests for options-reader
| -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({})); + }); +}); |
