Skip to content

Commit a2e15a2

Browse files
author
cloudhead
committed
better vow counting
1 parent 7beb71d commit a2e15a2

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

lib/vows/suite.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,24 @@ this.Suite.prototype = new(function () {
5555
// so we know when the tests are over.
5656
// We match the keys against `matcher`, to decide
5757
// whether or not they should be included in the test.
58-
(function count(tests) {
58+
(function count(tests, _match) {
5959
var match = false;
60-
batch.remaining ++;
60+
6161
Object.keys(tests).filter(function (k) {
6262
return k !== 'topic';
6363
}).forEach(function (key) {
64-
if (typeof(tests[key]) === "object") {
65-
if (! (match = count(tests[key]) ||
66-
match || vows.options.matcher.test(key))) {
67-
delete tests[key];
68-
batch.remaining --;
69-
}
64+
match = _match || matcher.test(key);
65+
66+
if (typeof(tests[key]) === 'object') {
67+
match = count(tests[key], match);
7068
}
7169
});
70+
71+
if (match) { batch.remaining ++ }
72+
else { tests._skip = true }
73+
7274
return match;
73-
})(tests);
75+
})(tests, false);
7476
}
7577
batch._remaining = batch.remaining;
7678
};

0 commit comments

Comments
 (0)