Skip to content

Commit

Permalink
fix for test.only only2 test
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Mar 5, 2014
1 parent 412d169 commit 40cad7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 5 additions & 2 deletions index.js
Expand Up @@ -23,8 +23,8 @@ exports = module.exports = (function () {
};

lazyLoad.only = function () {
return getHarness.only.apply(this, arguments);
}
return getHarness().only.apply(this, arguments);
};

lazyLoad.createStream = function (opts) {
if (!opts) opts = {};
Expand Down Expand Up @@ -81,8 +81,10 @@ function createExitHarness (conf) {
}

if (!ended) {
var only = harness._results._only;
for (var i = 0; i < harness._tests.length; i++) {
var t = harness._tests[i];
if (only && t.name !== only) continue;
t._exit();
}
}
Expand Down Expand Up @@ -122,6 +124,7 @@ function createHarness (conf_) {
results.push(t);
return t;
};
test._results = results;

test._tests = [];

Expand Down
4 changes: 1 addition & 3 deletions lib/results.js
Expand Up @@ -175,9 +175,7 @@ function getNextTest (results) {

do {
var t = results.tests.shift();
if (!t) {
return null;
}
if (!t) continue;
if (results._only === t.name) {
return t;
}
Expand Down

0 comments on commit 40cad7d

Please sign in to comment.