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
+36
View File
@@ -0,0 +1,36 @@
/* eslint-disable no-restricted-syntax */
import fs from 'fs';
import path from 'path';
import {
expect
} from 'chai';
import writeIndex from '../src/utilities/writeIndex';
import codeExample from './codeExample';
const fixturesPath = path.resolve(__dirname, 'fixtures/write-index');
describe('writeIndex()', () => {
it('creates index in target directory', () => {
const indexFilePath = path.resolve(fixturesPath, 'mixed/index.js');
try {
fs.unlinkSync(indexFilePath);
// eslint-disable-next-line no-empty
} catch (error) {
}
writeIndex([path.resolve(fixturesPath, 'mixed')]);
const indexCode = fs.readFileSync(indexFilePath, 'utf8');
expect(indexCode).to.equal(codeExample(`
'create index';
export bar from './bar';
export foo from './foo.js';
`));
});
});