Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Apr 15, 2019
1 parent fadc9c8 commit 823c307
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ chai.should();
const {promisify} = require('util');
const rimraf = promisify(require('rimraf'));
const mkdir = promisify(fs.mkdir);
const supportsDirent = 'Dirent' in fs;

const readdirp = require('.');

Expand Down Expand Up @@ -171,8 +172,10 @@ describe('filtering', () => {
const res = await read({fileFilter: (entry) => sysPath.extname(entry.fullPath) === '.js'});
res.map(e => e.basename).should.deep.equal(['a.js', 'c.js', 'd.js']);

const res2 = await read({fileFilter: (entry) => entry.dirent.isFile() });
res2.map(e => e.basename).should.deep.equal(['a.js', 'b.txt', 'c.js', 'd.js']);
if (supportsDirent) {
const res2 = await read({fileFilter: (entry) => entry.dirent.isFile() });
res2.map(e => e.basename).should.deep.equal(['a.js', 'b.txt', 'c.js', 'd.js']);
}
});
it('function with stats', async () => {
const res = await read({alwaysStat: true, fileFilter: (entry) => sysPath.extname(entry.fullPath) === '.js'});
Expand Down

0 comments on commit 823c307

Please sign in to comment.