aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-01-07 22:29:04 +0000
committerMichael Williamson <mike@zwobble.org>2014-01-07 22:29:04 +0000
commitbfc33eec2b0a22e4bb0ee2412ec22df636134330 (patch)
tree065db6da90cbdc17ddc85d38e2f8e8303dc33ee1 /tests
parentbc6e9ac4ee638fdc11019c979e3f03b9d7098e3f (diff)
Append standard style map to custom style map
Diffstat (limited to 'tests')
-rw-r--r--tests/options-reader.tests.js13
1 files changed, 13 insertions, 0 deletions
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];
+}