source: imaps-frontend/node_modules/jsx-ast-utils/__tests__/src/index-test.js@ d565449

main
Last change on this file since d565449 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 */
2import fs from 'fs';
3import path from 'path';
4import assert from 'assert';
5import core from '../../src/index';
6
7const src = fs.readdirSync(path.resolve(__dirname, '../../src'))
8 .filter((f) => f.indexOf('.js') >= 0)
9 .map((f) => path.basename(f, '.js'));
10
11describe('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.