UNPKG

901 BJavaScriptView Raw
1const assert = require('assert');
2const path = require('path');
3let importer = require('../namespace/import');
4
5describe("import methods (alias for require)", function () {
6
7 it("should import from the cwd", function () {
8 let val = importer('tests/mocks/import-me');
9 assert.equal(val, 'yep');
10 });
11
12 it("should import from the cwd using Reverse camelize", function () {
13 let val = importer('QueryUserMocksTests');
14 assert.equal(val, 'yes');
15 });
16
17 it("should import from the cwd using Reverse camelize with dashed file name", function () {
18 let val = importer('Import-meMocksTests'); // as ugly as it gets
19 assert.equal(val, 'yep');
20 });
21
22 it("should import from the cwd using Reverse camelize with dashed file name and dashed folder name", function () {
23 let val = importer('Foo-barImport-pathMocksTests'); // as ugly as it gets
24 assert.equal(val, 'foo');
25 });
26
27});