From bfc33eec2b0a22e4bb0ee2412ec22df636134330 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 7 Jan 2014 22:29:04 +0000 Subject: Append standard style map to custom style map --- tests/options-reader.tests.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/options-reader.tests.js b/tests/options-reader.tests.js index d493ae6..073b3a5 100644 --- a/tests/options-reader.tests.js +++ b/tests/options-reader.tests.js @@ -1,5 +1,6 @@ var assert = require("assert"); +var style = require("../").style; var optionsReader = require("../lib/options-reader"); var standardOptions = optionsReader._standardOptions; var readOptions = optionsReader.readOptions; @@ -13,4 +14,16 @@ describe('readOptions', function() { it('standard options are used if options is empty', function() { assert.deepEqual(standardOptions, readOptions({})); }); + + it('custom style mappings are prepended to standard style mappings', function() { + var options = readOptions({ + styleMap: "p.SectionTitle => h2" + }); + assert.deepEqual(style("p.SectionTitle => h2"), options.styleMap[0]); + assert.deepEqual(standardOptions.styleMap, options.styleMap.slice(1)); + }); }); + +function last(array) { + return array[array.length - 1]; +} -- cgit v1.2.3