aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-08-14 22:16:18 +0100
committerMichael Williamson <mike@zwobble.org>2015-08-14 22:16:18 +0100
commitda7ca2ccd9542f6a280bf5b676ea111a8e102729 (patch)
treef1f90661d5f2dd0542e53f7a5bf91669a4b206cf /tests
parent4b4ec85bc4f49e72244f7219539124b45b876d8e (diff)
Ignore lines in style map beginning with #
Diffstat (limited to 'tests')
-rw-r--r--tests/options-reader.tests.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/options-reader.tests.js b/tests/options-reader.tests.js
index 2c43b7c..94c864c 100644
--- a/tests/options-reader.tests.js
+++ b/tests/options-reader.tests.js
@@ -14,7 +14,7 @@ describe('readOptions', function() {
assert.deepEqual(standardOptions, readOptions({}));
});
- it('custom style mappings are prepended to standard style mappings', function() {
+ it('custom style map as string is prepended to standard style map', function() {
var options = readOptions({
styleMap: "p.SectionTitle => h2"
});
@@ -22,6 +22,22 @@ describe('readOptions', function() {
assert.deepEqual(standardOptions.styleMap, options.styleMap.slice(1));
});
+ 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));
+ });
+
+ 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));
+ });
+
it('default style mappings are ignored if includeDefaultStyleMap is false', function() {
var options = readOptions({
styleMap: "p.SectionTitle => h2",