diff --git a/test/readers/binary.js b/test/readers/binary.js index 27b6bcb..f336464 100644 --- a/test/readers/binary.js +++ b/test/readers/binary.js @@ -8,22 +8,19 @@ beforeEach(function (done) { }) describe('binary', function () { - it('module is required', function (done) { + it('module is required', function () { assert.ok(this.bin) - done() }) - it('has a load function', function (done) { + it('has a load function', function () { assert.ok(typeof this.bin.load === 'function') - done() }) - it('loads the test binary file', function (done) { + it('loads the test binary file', function () { const testBin = path.join('test', 'config', 'test.binary') const result = this.bin.load(testBin) assert.ok(Buffer.isBuffer(result)) assert.equal(result.length, 120) assert.deepEqual(result, fs.readFileSync(testBin)) - done() }) }) diff --git a/test/readers/flat.js b/test/readers/flat.js index 34852b5..5ecaeba 100644 --- a/test/readers/flat.js +++ b/test/readers/flat.js @@ -8,32 +8,27 @@ beforeEach(function (done) { }) describe('flat', function () { - it('module is required', function (done) { + it('module is required', function () { assert.ok(this.flat) - done() }) - it('has a load function', function (done) { + it('has a load function', function () { assert.ok(typeof this.flat.load === 'function') - done() }) - it('loads the test flat file, as list', function (done) { + it('loads the test flat file, as list', function () { const result = this.flat.load('test/config/test.flat', 'list', null, regex) assert.deepEqual(result, ['line1', 'line2', 'line3', 'line5']) - done() }) - it('loads the test flat file, unspecified type', function (done) { + it('loads the test flat file, unspecified type', function () { const result = this.flat.load('test/config/test.flat', null, null, regex) assert.deepEqual(result, 'line1') - done() }) - it('returns hostname for empty "me"', function (done) { + it('returns hostname for empty "me"', function () { const result = this.flat.load('test/config/me', null, null, regex) console.log(result) assert.ok(result) - done() }) }) diff --git a/test/readers/hjson.js b/test/readers/hjson.js index 9efbccd..816e46f 100644 --- a/test/readers/hjson.js +++ b/test/readers/hjson.js @@ -7,23 +7,20 @@ beforeEach(function (done) { }) describe('hjson', function () { - it('module is required', function (done) { + it('module is required', function () { assert.ok(this.hjson) - done() }) - it('has a load function', function (done) { + it('has a load function', function () { assert.ok(typeof this.hjson.load === 'function') - done() }) - it('loads the test HJSON file', function (done) { + it('loads the test HJSON file', function () { const result = this.hjson.load(path.join('test', 'config', 'test.hjson')) // console.log(result) assert.equal(result.matt, 'waz here and also made comments') assert.ok(result.differentArray.length) assert.ok(result.object['has a property one']) assert.ok(result.object['has a property two']) - done() }) }) diff --git a/test/readers/ini.js b/test/readers/ini.js index e9d96c0..c979d24 100644 --- a/test/readers/ini.js +++ b/test/readers/ini.js @@ -11,17 +11,15 @@ beforeEach(function (done) { }) describe('ini', function () { - it('requires', function (done) { + it('requires', function () { assert.ok(this.ini) - done() }) - it('has a load function', function (done) { + it('has a load function', function () { assert.ok(typeof this.ini.load === 'function') - done() }) - it('loads the test ini file', function (done) { + it('loads the test ini file', function () { const result = this.ini.load('test/config/test.ini', {}, regex) // console.log(result); assert.deepEqual(result.main, { @@ -30,29 +28,26 @@ describe('ini', function () { str_true: 'true', str_false: 'false', }) - done() }) describe('test.ini', function () { - it('no opts', function (done) { + it('no opts', function () { const r = this.ini.load('test/config/test.ini', {}, regex) assert.strictEqual(r.main.bool_true, 'true') assert.strictEqual(r.main.bool_false, 'false') assert.strictEqual(r.main.str_true, 'true') assert.strictEqual(r.main.str_false, 'false') - done() }) - it('opts', function (done) { + it('opts', function () { const r = this.ini.load('test/config/test.ini', this.opts, regex).main assert.strictEqual(r.bool_true, true) assert.strictEqual(r.bool_false, false) assert.strictEqual(r.str_true, 'true') assert.strictEqual(r.str_false, 'false') - done() }) - it('sect1, opts', function (done) { + it('sect1, opts', function () { const r = this.ini.load( 'test/config/test.ini', { @@ -64,10 +59,9 @@ describe('ini', function () { assert.strictEqual(r.sect1.bool_false, false) assert.strictEqual(r.sect1.str_true, 'true') assert.strictEqual(r.sect1.str_false, 'false') - done() }) - it('sect1, opts, w/defaults', function (done) { + it('sect1, opts, w/defaults', function () { const r = this.ini.load( 'test/config/test.ini', { @@ -86,10 +80,9 @@ describe('ini', function () { assert.strictEqual(r.sect1.str_false, 'false') assert.strictEqual(r.sect1.bool_true_default, true) assert.strictEqual(r.sect1.bool_false_default, false) - done() }) - it('wildcard boolean', function (done) { + it('wildcard boolean', function () { const r = this.ini.load( 'test/config/test.ini', { @@ -102,24 +95,21 @@ describe('ini', function () { assert.strictEqual(r.main.is_bool, undefined) assert.strictEqual(r['foo.com'].is_bool, true) assert.strictEqual(r['bar.com'].is_bool, false) - done() }) }) describe('non-exist.ini (empty)', function () { - it('is template', function (done) { + it('is template', function () { assert.deepEqual(this.ini.empty(), { main: {} }) - done() }) - it('boolean', function (done) { + it('boolean', function () { assert.deepEqual(this.ini.empty({ booleans: ['reject'] }), { main: { reject: false }, }) - done() }) - it('boolean true default', function (done) { + it('boolean true default', function () { assert.deepEqual(this.ini.empty({ booleans: ['+reject'] }), { main: { reject: true }, }) @@ -129,10 +119,9 @@ describe('ini', function () { assert.deepEqual(this.ini.empty({ booleans: ['main.+reject'] }), { main: { reject: true }, }) - done() }) - it('boolean false default', function (done) { + it('boolean false default', function () { assert.deepEqual(this.ini.empty({ booleans: ['-reject'] }), { main: { reject: false }, }) @@ -142,10 +131,9 @@ describe('ini', function () { assert.deepEqual(this.ini.empty({ booleans: ['main.-reject'] }), { main: { reject: false }, }) - done() }) - it('boolean false default, section', function (done) { + it('boolean false default, section', function () { assert.deepEqual(this.ini.empty({ booleans: ['-reject.boolf'] }), { main: {}, reject: { boolf: false }, @@ -154,15 +142,13 @@ describe('ini', function () { main: {}, reject: { boolt: true }, }) - done() }) }) describe('goobers.ini', function () { - it('goobers.ini has invalid entry', function (done) { + it('goobers.ini has invalid entry', function () { const result = this.ini.load('test/config/goobers.ini', {}, regex) assert.deepEqual(result, { main: {} }) - done() }) }) }) diff --git a/test/readers/json.js b/test/readers/json.js index 5370b6d..5378790 100644 --- a/test/readers/json.js +++ b/test/readers/json.js @@ -6,22 +6,19 @@ beforeEach(function (done) { }) describe('json', function () { - it('module is required', function (done) { + it('module is required', function () { assert.ok(this.json) - done() }) - it('has a load function', function (done) { + it('has a load function', function () { assert.ok(typeof this.json.load === 'function') - done() }) - it('loads the test JSON file', function (done) { + it('loads the test JSON file', function () { const result = this.json.load('test/config/test.json') // console.log(result); assert.equal(result.matt, 'waz here') assert.ok(result.array.length) assert.ok(result.objecty['has a property']) - done() }) }) diff --git a/test/readers/yaml.js b/test/readers/yaml.js index 5997ed7..f296190 100644 --- a/test/readers/yaml.js +++ b/test/readers/yaml.js @@ -6,22 +6,19 @@ beforeEach(function (done) { }) describe('yaml', function () { - it('module is required', function (done) { + it('module is required', function () { assert.ok(this.yaml) - done() }) - it('has a load function', function (done) { + it('has a load function', function () { assert.ok(typeof this.yaml.load === 'function') - done() }) - it('loads the test yaml file', function (done) { + it('loads the test yaml file', function () { const result = this.yaml.load('test/config/test.yaml') assert.strictEqual(result.main.bool_true, true) assert.equal(result.matt, 'waz here') assert.ok(result.array.length) assert.ok(result.objecty['has a property']) - done() }) })