Skip to content
Browse files

Fixed all node_modules spec bug.

Previously the spec-collection runned every spec found under node_modules.
  • Loading branch information...
1 parent 535949c commit 510a1aa7c1b4fd2a83a0283e645f37276304047f @mcollina mcollina committed Jan 19, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/jasmine-node/spec-collection.js
View
10 lib/jasmine-node/spec-collection.js
@@ -19,10 +19,14 @@ exports.load = function(loadpath, matcher) {
for (var i = 0; i < wannaBeSpecs.length; i++) {
var file = wannaBeSpecs[i];
- if (fs.statSync(file).isFile()) {
- if (matcher.test(path.basename(file))) {
- specs.push(createSpecObj(file));
+ try {
+ if (fs.statSync(file).isFile()) {
+ if (!/.*node_modules.*/.test(file) && matcher.test(path.basename(file))) {
+ specs.push(createSpecObj(file));
+ }
}
+ } catch(e) {
+ // nothing to do here
}
}
};

0 comments on commit 510a1aa

Please sign in to comment.
Something went wrong with that request. Please try again.