Skip to content

Commit

Permalink
Add (failing) tests for ignored directories
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlafroscia committed Jul 26, 2016
1 parent 9a4ecc6 commit ac4c9c9
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,45 @@ test('walkSync with matchers', function (t) {

t.end();
});

test('walksync with ignore pattern', function (t) {
t.deepEqual(walkSync('test/fixtures', {
ignore: ['dir']
}), [
'foo.txt',
'foo/',
'foo/a.js',
'some-other-dir/',
'some-other-dir/qux.txt',
'symlink1/',
'symlink1/qux.txt',
'symlink2'
]);

t.deepEqual(walkSync('test/fixtures', {
ignore: ['**/subdir']
}), [
'dir/',
'dir/bar.txt',
'dir/zzz.txt',
'foo.txt',
'foo/',
'foo/a.js',
'some-other-dir/',
'some-other-dir/qux.txt',
'symlink1/',
'symlink1/qux.txt',
'symlink2'
]);

t.deepEqual(walkSync('test/fixtures', {
globs: ['**/*.txt'],
ignore: ['dir']
}), [
'foo.txt',
'some-other-dir/qux.txt',
'symlink1/qux.txt'
]);

t.end();
});

0 comments on commit ac4c9c9

Please sign in to comment.