Sha256: 0312b213a9a49aa381fc7c5e7c494ecbb57e28fd55a1a56eb6977f193d4ca548

Contents?: true

Size: 795 Bytes

Versions: 21

Compression:

Stored size: 795 Bytes

Contents

var test = require('tape'),
fs = require('fs'),
path = require('path'),
walk  = require('../walkdir.js');

test('should not emit fail events for empty dirs',function(t){
  fs.mkdir('./empty',function(err,data){
    if(err) {
      t.equals(err.code,'EEXIST','if error code on mkdir for fixture it should only be because it exists already');
    }

    var paths = [];
    var dirs = [];
    var emptys = [];
    var fails = [];

    var em = walk('./');

    em.on('fail',function(path,err){
      fails.push(path); 
    });

    em.on('empty',function(path,err){
      emptys.push(path); 
    });

    em.on('end',function(){
      t.equals(fails.length,0,'should not have any fails');
      t.equals(path.basename(emptys[0]),'empty','should find empty dir');
      t.end();
    });
  });
});

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
ela-4.1.6 node_modules/walkdir/test/nofailemptydir.js
ela-4.1.5 node_modules/walkdir/test/nofailemptydir.js
ela-4.1.4 node_modules/walkdir/test/nofailemptydir.js
ela-4.1.3 node_modules/walkdir/test/nofailemptydir.js
ela-4.1.2 node_modules/walkdir/test/nofailemptydir.js
ela-4.1.1 node_modules/walkdir/test/nofailemptydir.js
ela-4.1.0 node_modules/walkdir/test/nofailemptydir.js
ela-4.0.0 node_modules/walkdir/test/nofailemptydir.js
ela-3.4.3 node_modules/walkdir/test/nofailemptydir.js
ela-3.4.2 node_modules/walkdir/test/nofailemptydir.js
ela-3.4.0 node_modules/walkdir/test/nofailemptydir.js
ela-3.3.1 node_modules/walkdir/test/nofailemptydir.js
ela-3.3.0 node_modules/walkdir/test/nofailemptydir.js
ela-3.2.0 node_modules/walkdir/test/nofailemptydir.js
ela-3.1.1 node_modules/walkdir/test/nofailemptydir.js
ela-3.1.0 node_modules/walkdir/test/nofailemptydir.js
ela-3.0.0 node_modules/walkdir/test/nofailemptydir.js
ela-2.0.0 node_modules/walkdir/test/nofailemptydir.js
ela-1.1.0 node_modules/walkdir/test/nofailemptydir.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/walkdir/test/nofailemptydir.js