Skip to content

Commit

Permalink
Don't end before implicit bailout from bufferend child bailout
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jan 9, 2017
1 parent c82c752 commit 642fada
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/test.js
Expand Up @@ -586,7 +586,7 @@ Test.prototype._runChild = function runChild (child, name, extra, cb) {
extra._tapChildBailed = child._bailedOut
self.ok(child._ok, child._name, extra)

if (endThis) {
if (endThis && !child._bailedOut) {
self._ending = false
self.end(IMPLICIT)
}
Expand Down
17 changes: 17 additions & 0 deletions test/test/descendant-fail--bail--buffer.tap
@@ -0,0 +1,17 @@
TAP version 13
1..1
not ok 1 - parent {
1..1
not ok 1 - child {
1..1
not ok 1 - nope
---
{"at":{"column":7,"file":"test/test/descendant-fail.js","line":7},"source":"t.fail('nope')\n"}
...

Bail out! # nope
}
}

Bail out! # nope

14 changes: 14 additions & 0 deletions test/test/descendant-fail--bail.tap
@@ -0,0 +1,14 @@
TAP version 13
1..1
# Subtest: parent
1..1
# Subtest: child
1..1
not ok 1 - nope
---
{"at":{"column":7,"file":"test/test/descendant-fail.js","line":7},"source":"t.fail('nope')\n"}
...

Bail out! # nope
Bail out! # nope

20 changes: 20 additions & 0 deletions test/test/descendant-fail--buffer.tap
@@ -0,0 +1,20 @@
TAP version 13
1..1
not ok 1 - parent {
1..1
not ok 1 - child {
1..1
not ok 1 - nope
---
{"at":{"column":7,"file":"test/test/descendant-fail.js","line":7},"source":"t.fail('nope')\n"}
...

# failed 1 of 1 tests
}

# failed 1 of 1 tests
}

# failed 1 of 1 tests
___/# time=[0-9.]+(ms)?/~~~

9 changes: 9 additions & 0 deletions test/test/descendant-fail.js
@@ -0,0 +1,9 @@
var t = require('../..')
t.plan(1)
t.test('parent', function (t) {
t.plan(1)
t.test('child', function (t) {
t.plan(1)
t.fail('nope')
})
})
20 changes: 20 additions & 0 deletions test/test/descendant-fail.tap
@@ -0,0 +1,20 @@
TAP version 13
1..1
# Subtest: parent
1..1
# Subtest: child
1..1
not ok 1 - nope
---
{"at":{"column":7,"file":"test/test/descendant-fail.js","line":7},"source":"t.fail('nope')\n"}
...

# failed 1 of 1 tests
not ok 1 - child ___/# time=[0-9.]+(ms)?/~~~

# failed 1 of 1 tests
not ok 1 - parent ___/# time=[0-9.]+(ms)?/~~~

# failed 1 of 1 tests
___/# time=[0-9.]+(ms)?/~~~

0 comments on commit 642fada

Please sign in to comment.