1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-10 11:20:19 +00:00
musix-oss/node_modules/walkdir/test/ignore-during.js
2020-03-03 22:30:50 +02:00

20 lines
471 B
JavaScript

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();
})
})