aboutsummaryrefslogtreecommitdiff
path: root/test/options-reader.tests.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-07-07 22:17:34 +0100
committerMichael Williamson <mike@zwobble.org>2016-07-07 22:17:34 +0100
commita080fc59a3fca08bdc6e23a2eeae440f5c7047b3 (patch)
tree3d56033c294c617eb7de6b693750efb70a81dd4f /test/options-reader.tests.js
parent28a0e40b645c051d91626ca90959e847b061c8da (diff)
Use exports for all tests
Diffstat (limited to 'test/options-reader.tests.js')
-rw-r--r--test/options-reader.tests.js71
1 files changed, 35 insertions, 36 deletions
diff --git a/test/options-reader.tests.js b/test/options-reader.tests.js
index 94c864c..06e0764 100644
--- a/test/options-reader.tests.js
+++ b/test/options-reader.tests.js
@@ -3,46 +3,45 @@ var assert = require("assert");
var optionsReader = require("../lib/options-reader");
var standardOptions = optionsReader._standardOptions;
var readOptions = optionsReader.readOptions;
+var test = require("./test")(module);
-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({}));
- });
-
- it('custom style map as string 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));
+test('standard options are used if options is undefined', function() {
+ assert.deepEqual(standardOptions, readOptions(undefined));
+});
+
+test('standard options are used if options is empty', function() {
+ assert.deepEqual(standardOptions, readOptions({}));
+});
+
+test('custom style map as string is prepended to standard style map', function() {
+ var options = readOptions({
+ styleMap: "p.SectionTitle => h2"
});
-
- 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));
+ assert.deepEqual("p.SectionTitle => h2", options.styleMap[0]);
+ assert.deepEqual(standardOptions.styleMap, options.styleMap.slice(1));
+});
+
+test('custom style map as array is prepended to standard style map', function() {
+ var options = readOptions({
+ styleMap: ["p.SectionTitle => h2"]
});
-
- 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));
+ assert.deepEqual("p.SectionTitle => h2", options.styleMap[0]);
+ assert.deepEqual(standardOptions.styleMap, options.styleMap.slice(1));
+});
+
+test('lines starting with # in custom style map are ignored', function() {
+ var options = readOptions({
+ styleMap: "# p.SectionTitle => h3\np.SectionTitle => h2"
});
-
- it('default style mappings are ignored if includeDefaultStyleMap is false', function() {
- var options = readOptions({
- styleMap: "p.SectionTitle => h2",
- includeDefaultStyleMap: false
- });
- assert.deepEqual(["p.SectionTitle => h2"], options.styleMap);
+ assert.deepEqual("p.SectionTitle => h2", options.styleMap[0]);
+ assert.deepEqual(standardOptions.styleMap, options.styleMap.slice(1));
+});
+
+test('default style mappings are ignored if includeDefaultStyleMap is false', function() {
+ var options = readOptions({
+ styleMap: "p.SectionTitle => h2",
+ includeDefaultStyleMap: false
});
+ assert.deepEqual(["p.SectionTitle => h2"], options.styleMap);
});