forked from enigma-io/boundless
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexports.spec.js
More file actions
21 lines (16 loc) · 766 Bytes
/
exports.spec.js
File metadata and controls
21 lines (16 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as Boundless from './exports.js';
import * as _ from 'lodash';
import fs from 'fs';
_.mixin({'pascalCase': _.flow(_.camelCase, _.upperFirst)});
describe('exports', () => {
it('does not have any undefined keys (if failed, the require is probably wrong)', () => {
Object.keys(Boundless).forEach((key) => expect(Boundless[key]).not.toBeUndefined());
});
it('has as many keys as there are component folders (except utils)', () => {
const folders = fs.readdirSync('packages').filter((name) => /^boundless-(?!utils)/.test(name));
folders.forEach((name) => {
const exportName = _.pascalCase(name.replace('boundless-', ''));
expect(Boundless[exportName]).not.toBeUndefined();
});
});
});