split b64u functions into separate package
[squeep-mystery-box] / test / lib / common.js
1 /* eslint-env mocha */
2 'use strict';
3
4 const assert = require('assert');
5 const common = require('../../lib/common');
6
7 describe('Common', function () {
8
9 describe('fileScope', function () {
10 it('names a file path', function () {
11 const filename = 'lib/foo/bar.js';
12 const result = common.fileScope(filename)('baz');
13 assert.strictEqual(result, 'bar:baz');
14 });
15 it('names an index path', function () {
16 const filename = 'lib/foo/index.js';
17 const result = common.fileScope(filename)('baz');
18 assert.strictEqual(result, 'foo:baz');
19 });
20 }); // fileScope
21
22 }); // Common