@@ -15,7 +15,7 @@ describe('fs.readdirSyncRecursive()', function () {
1515
1616 it ( 'should work at the root with a filter' , function ( ) {
1717 var files = read ( path . join ( __dirname , '..' ) , function ( name ) {
18- return name [ 0 ] !== '.' && name !== 'node_modules' && name !== 'coverage'
18+ return name [ 0 ] !== '.' && name !== 'node_modules' && name !== 'coverage' && name !== 'package-lock.json'
1919 } )
2020
2121 files . length . should . equal ( 5 )
@@ -29,6 +29,21 @@ describe('fs.readdirSyncRecursive()', function () {
2929
3030 } )
3131
32+ it ( 'should filter pass dir' , function ( ) {
33+ var files = read ( path . join ( __dirname , '..' ) , function ( name , index , dir ) {
34+ return name [ 0 ] !== '.' && name !== 'node_modules' && name !== 'coverage' && dir !== __dirname && name !== 'package-lock.json'
35+ } )
36+
37+ files . length . should . equal ( 4 )
38+ files . sort ( ) . should . eql ( [
39+ 'index.js' ,
40+ 'LICENSE' ,
41+ 'package.json' ,
42+ 'README.md'
43+ ] . sort ( ) )
44+
45+ } )
46+
3247 it ( 'should work with the symlinked file' , function ( ) {
3348 try {
3449 var linkname = __filename + '-link'
@@ -69,7 +84,7 @@ describe('fs.readdirSyncRecursive()', function () {
6984 fs . symlinkSync ( path . join ( __dirname , '..' ) , linkname , 'dir' )
7085
7186 var files = read ( linkname , function ( name ) {
72- return name [ 0 ] !== '.' && name !== 'node_modules' && name !== 'coverage'
87+ return name [ 0 ] !== '.' && name !== 'node_modules' && name !== 'coverage' && name !== 'package-lock.json'
7388 } )
7489
7590 files . length . should . equal ( 5 )
0 commit comments