chore: rename ./tests to ./test

This commit is contained in:
Gajus Kuizinas
2016-11-01 15:31:00 +00:00
parent 78109764f7
commit 272a836c96
45 changed files with 1 additions and 1 deletions
+59
View File
@@ -0,0 +1,59 @@
/* eslint-disable no-restricted-syntax */
import {
expect
} from 'chai';
import createIndexCode from '../src/utilities/createIndexCode';
import codeExample from './codeExample';
describe('createIndexCode()', () => {
it('describes no children', () => {
const indexCode = createIndexCode([]);
expect(indexCode).to.equal(codeExample(`
'create index';
`));
});
it('describes a single child', () => {
const indexCode = createIndexCode(['foo']);
expect(indexCode).to.equal(codeExample(`
'create index';
export foo from './foo';
`));
});
it('describes multiple children', () => {
const indexCode = createIndexCode(['bar', 'foo']);
expect(indexCode).to.equal(codeExample(`
'create index';
export bar from './bar';
export foo from './foo';
`));
});
context('file with extension', () => {
it('removes the extension from the export statement', () => {
const indexCode = createIndexCode(['foo.js']);
expect(indexCode).to.equal(codeExample(`
'create index';
export foo from './foo.js';
`));
});
});
context('multiple, unsorted', () => {
it('sorts the files', () => {
const indexCode = createIndexCode(['foo', 'bar']);
expect(indexCode).to.equal(codeExample(`
'create index';
export bar from './bar';
export foo from './foo';
`));
});
});
});