diff --git a/bin/vows b/bin/vows index 4bac746..c428554 100755 --- a/bin/vows +++ b/bin/vows @@ -514,12 +514,19 @@ function paths(dir) { (function traverse(dir, stack) { stack.push(dir); fs.readdirSync(stack.join('/')).forEach(function (file) { + // + // Skip dotfiles and `vendor` directory before `fs.stat()`ing them. + // Not doing so causes race conditions with Emacs buffer files + // (`.#filename.js`). + // + if (file[0] == '.' || file === 'vendor') { + return; + } + var path = stack.concat([file]).join('/'), stat = fs.statSync(path); - if (file[0] == '.' || file === 'vendor') { - return; - } else if (stat.isFile() && fileExt.test(file)) { + if (stat.isFile() && fileExt.test(file)) { paths.push(path); } else if (stat.isDirectory()) { traverse(file, stack);