Skip to content

Commit 40cad7d

Browse files
author
James Halliday
committed
fix for test.only only2 test
1 parent 412d169 commit 40cad7d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

index.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ exports = module.exports = (function () {
2323
};
2424

2525
lazyLoad.only = function () {
26-
return getHarness.only.apply(this, arguments);
27-
}
26+
return getHarness().only.apply(this, arguments);
27+
};
2828

2929
lazyLoad.createStream = function (opts) {
3030
if (!opts) opts = {};
@@ -81,8 +81,10 @@ function createExitHarness (conf) {
8181
}
8282

8383
if (!ended) {
84+
var only = harness._results._only;
8485
for (var i = 0; i < harness._tests.length; i++) {
8586
var t = harness._tests[i];
87+
if (only && t.name !== only) continue;
8688
t._exit();
8789
}
8890
}
@@ -122,6 +124,7 @@ function createHarness (conf_) {
122124
results.push(t);
123125
return t;
124126
};
127+
test._results = results;
125128

126129
test._tests = [];
127130

lib/results.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@ function getNextTest (results) {
175175

176176
do {
177177
var t = results.tests.shift();
178-
if (!t) {
179-
return null;
180-
}
178+
if (!t) continue;
181179
if (results._only === t.name) {
182180
return t;
183181
}

0 commit comments

Comments
 (0)