main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
921 bytes
|
Line | |
---|
1 | /* eslint-env mocha */
|
---|
2 | import fs from 'fs';
|
---|
3 | import path from 'path';
|
---|
4 | import assert from 'assert';
|
---|
5 | import core from '../../src/index';
|
---|
6 |
|
---|
7 | const src = fs.readdirSync(path.resolve(__dirname, '../../src'))
|
---|
8 | .filter((f) => f.indexOf('.js') >= 0)
|
---|
9 | .map((f) => path.basename(f, '.js'));
|
---|
10 |
|
---|
11 | describe('main export', () => {
|
---|
12 | it('should export an object', () => {
|
---|
13 | const expected = 'object';
|
---|
14 | const actual = typeof core;
|
---|
15 |
|
---|
16 | assert.equal(actual, expected);
|
---|
17 | });
|
---|
18 |
|
---|
19 | src.filter((f) => f !== 'index').forEach((f) => {
|
---|
20 | it(`should export ${f}`, () => {
|
---|
21 | assert.equal(
|
---|
22 | core[f],
|
---|
23 | require(path.join('../../src/', f)).default // eslint-disable-line
|
---|
24 | );
|
---|
25 | });
|
---|
26 |
|
---|
27 | it(`should export ${f} from root`, () => {
|
---|
28 | const file = `${f}.js`;
|
---|
29 | const expected = true;
|
---|
30 | const actual = fs.statSync(path.join(path.resolve('.'), file)).isFile();
|
---|
31 |
|
---|
32 | assert.equal(actual, expected);
|
---|
33 | });
|
---|
34 | });
|
---|
35 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.