Comparing version 1.0.4 to 1.1.0
@@ -22,3 +22,3 @@ var Stream = require('stream'); | ||
nextTick(function next () { | ||
var t = results.tests.shift(); | ||
var t = getNextTest(results); | ||
if (!t && results.running) return; | ||
@@ -46,3 +46,3 @@ if (!t) return results.close(); | ||
if (self.only && self.only !== t.name && !parentT) { | ||
var nt = self.tests.shift(); | ||
var nt = getNextTest(self); | ||
if (nt) nt.run() | ||
@@ -99,3 +99,3 @@ else self.close(); | ||
if (t._skip) { | ||
var nt = self.tests.shift(); | ||
var nt = getNextTest(self); | ||
if (nt) nt.run(); | ||
@@ -110,4 +110,5 @@ else self.close(); | ||
if (self.running === 0 && self.tests.length) { | ||
var nt = self.tests.shift(); | ||
nt.run(); | ||
var nt = getNextTest(self); | ||
if (nt) nt.run(); | ||
else self.close(); | ||
} | ||
@@ -198,1 +199,17 @@ else if (self.running === 0) { | ||
} | ||
function getNextTest(results) { | ||
if (!results.only) { | ||
return results.tests.shift(); | ||
} | ||
do { | ||
var t = results.tests.shift(); | ||
if (!t) { | ||
return null; | ||
} | ||
if (results.only === t.name) { | ||
return t; | ||
} | ||
} while (results.tests.length !== 0) | ||
} |
{ | ||
"name" : "tape", | ||
"version" : "1.0.4", | ||
"version" : "1.1.0", | ||
"description" : "tap-producing test harness for node and browsers", | ||
@@ -5,0 +5,0 @@ "main" : "index.js", |
@@ -7,2 +7,3 @@ var tap = require('tap'); | ||
var tc = tap.createConsumer(); | ||
var ran = []; | ||
@@ -29,2 +30,3 @@ var rows = [] | ||
]) | ||
tt.deepEqual(ran, [ 3 ]); | ||
@@ -37,2 +39,3 @@ tt.end() | ||
test("never run fail", function (t) { | ||
ran.push(1); | ||
t.equal(true, false) | ||
@@ -43,2 +46,3 @@ t.end() | ||
test("never run success", function (t) { | ||
ran.push(2); | ||
t.equal(true, true) | ||
@@ -49,2 +53,3 @@ t.end() | ||
test.only("run success", function (t) { | ||
ran.push(3); | ||
t.ok(true, "assert name") | ||
@@ -51,0 +56,0 @@ t.end() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53595
1588