Change the index file format to use "export ... from" (fixes #3)
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
expect
|
||||
} from 'chai';
|
||||
|
||||
import createIndexCode from './../src/createIndexCode';
|
||||
import createIndexCode from './../src/utilities/createIndexCode';
|
||||
|
||||
import codeExample from './codeExample';
|
||||
|
||||
@@ -26,11 +26,7 @@ describe('createIndexCode()', () => {
|
||||
expect(indexCode).to.equal(codeExample(`
|
||||
'create index';
|
||||
|
||||
import foo from './foo';
|
||||
|
||||
export {
|
||||
foo
|
||||
};
|
||||
export foo from './foo';
|
||||
`));
|
||||
});
|
||||
it('describes multiple children', () => {
|
||||
@@ -41,13 +37,8 @@ export {
|
||||
expect(indexCode).to.equal(codeExample(`
|
||||
'create index';
|
||||
|
||||
import bar from './bar';
|
||||
import foo from './foo';
|
||||
|
||||
export {
|
||||
bar,
|
||||
foo
|
||||
};
|
||||
export bar from './bar';
|
||||
export foo from './foo';
|
||||
`));
|
||||
});
|
||||
context('file with extension', () => {
|
||||
@@ -59,11 +50,7 @@ export {
|
||||
expect(indexCode).to.equal(codeExample(`
|
||||
'create index';
|
||||
|
||||
import foo from './foo.js';
|
||||
|
||||
export {
|
||||
foo
|
||||
};
|
||||
export foo from './foo.js';
|
||||
`));
|
||||
});
|
||||
});
|
||||
@@ -76,13 +63,8 @@ export {
|
||||
expect(indexCode).to.equal(codeExample(`
|
||||
'create index';
|
||||
|
||||
import bar from './bar';
|
||||
import foo from './foo';
|
||||
|
||||
export {
|
||||
bar,
|
||||
foo
|
||||
};
|
||||
export bar from './bar';
|
||||
export foo from './foo';
|
||||
`));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
} from 'chai';
|
||||
|
||||
import path from 'path';
|
||||
import readDirectory from './../src/readDirectory';
|
||||
import readDirectory from './../src/utilities/readDirectory';
|
||||
|
||||
const fixturesPath = path.resolve(__dirname, './fixtures/read-directory');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
expect
|
||||
} from 'chai';
|
||||
import sortByDepth from './../src/sortByDepth';
|
||||
import sortByDepth from './../src/utilities/sortByDepth';
|
||||
|
||||
describe('sortByDepth()', () => {
|
||||
it('sorts from deepest to the most shallow', () => {
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
expect
|
||||
} from 'chai';
|
||||
import path from 'path';
|
||||
import validateTargetDirectory from './../src/validateTargetDirectory';
|
||||
import validateTargetDirectory from './../src/utilities/validateTargetDirectory';
|
||||
|
||||
const fixturesPath = path.resolve(__dirname, './fixtures/validate-target-directory');
|
||||
|
||||
|
||||
+3
-8
@@ -6,7 +6,7 @@ import {
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import codeExample from './codeExample';
|
||||
import writeIndex from './../src/writeIndex';
|
||||
import writeIndex from './../src/utilities/writeIndex';
|
||||
|
||||
const fixturesPath = path.resolve(__dirname, './fixtures/write-index');
|
||||
|
||||
@@ -30,13 +30,8 @@ describe('writeIndex()', () => {
|
||||
expect(indexCode).to.equal(codeExample(`
|
||||
'create index';
|
||||
|
||||
import bar from './bar';
|
||||
import foo from './foo.js';
|
||||
|
||||
export {
|
||||
bar,
|
||||
foo
|
||||
};
|
||||
export bar from './bar';
|
||||
export foo from './foo.js';
|
||||
`));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user