aboutsummaryrefslogtreecommitdiff
path: root/node_modules/walkdir/test/ignore-during.js
blob: 549eb4ac5b780defce8e45eb2d7e7a0948ad2a2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var test = require('tape')
var walkdir = require('../')

test('async events',function(t){
  var paths = [],
  files = [],
  dirs = [];

  var emitter = walkdir(__dirname+'/dir/foo',function(path){
    paths.push(path.replace(__dirname+'/',''));
    if(path === __dirname+'/dir/foo/a') this.ignore(__dirname+'/dir/foo/a');
  })

  emitter.on('end',function(){
    t.equals(paths.sort().join('|'),'dir/foo/a|dir/foo/x','should have ignored under a');
    t.end();
  })

})