feat: add option to exclude directories from index.js (#50)
* Add option to exclude directories from index.js * Update readDirectory.js * Update writeIndexCli.js * Update readDirectory.js * Update README
This commit is contained in:
committed by
Gajus Kuizinas
parent
1efd1c6c7b
commit
6aac149a8b
@@ -34,6 +34,12 @@ describe('readDirectory()', () => {
|
||||
|
||||
expect(names).to.deep.equal(['bar', 'foo']);
|
||||
});
|
||||
|
||||
it('excludes directories if ignoreDirectories = true', () => {
|
||||
const names = readDirectory(path.resolve(fixturesPath, 'children-index'), {ignoreDirectories: true});
|
||||
|
||||
expect(names).to.deep.equal([]);
|
||||
});
|
||||
});
|
||||
context('target directory contains files', () => {
|
||||
it('refers to the files (with extension)', () => {
|
||||
|
||||
Reference in New Issue
Block a user