X-Git-Url: http://git.squeep.com/?p=squeep-mystery-box;a=blobdiff_plain;f=test%2Flib%2Fcommon.js;fp=test%2Flib%2Fcommon.js;h=0000000000000000000000000000000000000000;hp=ad93ea17304b126368f8ff486d87e466a2b91bdc;hb=82e47c29e2c11196901826e68c5dc9b090d8c214;hpb=6c9e123b3c10ef5caafc1a5f352a4705a8579ca9 diff --git a/test/lib/common.js b/test/lib/common.js deleted file mode 100644 index ad93ea1..0000000 --- a/test/lib/common.js +++ /dev/null @@ -1,39 +0,0 @@ -/* eslint-env mocha */ -'use strict'; - -const assert = require('assert'); -const common = require('../../lib/common'); - -describe('Common', function () { - - describe('fileScope', function () { - it('names a file path', function () { - const filename = 'lib/foo/bar.js'; - const result = common.fileScope(filename)('baz'); - assert.strictEqual(result, 'bar:baz'); - }); - it('names an index path', function () { - const filename = 'lib/foo/index.js'; - const result = common.fileScope(filename)('baz'); - assert.strictEqual(result, 'foo:baz'); - }); - }); // fileScope - - describe('ensureArray', function () { - it('returns empty array for no data', function () { - const result = common.ensureArray(); - assert.deepStrictEqual(result, []); - }); - it('returns same array passed in', function () { - const expected = [1, 2, 3, 'foo']; - const result = common.ensureArray(expected); - assert.deepStrictEqual(result, expected); - }); - it('returns array containing non-array data', function () { - const data = 'bar'; - const result = common.ensureArray(data); - assert.deepStrictEqual(result, [data]); - }); - }); // ensureArray - -}); // Common