-
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Catch errors thrown in teardown handlers
- Loading branch information
Showing
8 changed files
with
179 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
TAP version 13 | ||
not ok 1 - child ___/# time=[0-9.]+(ms)?/~~~ { | ||
not ok 1 - test unfinished | ||
--- | ||
{"at":{"column":3,"file":"test/test/teardown-throw-autocomplete.js","line":10},"source":"t.test('child', function (t) {\n","test":"child"} | ||
... | ||
|
||
Bail out! # test unfinished | ||
} | ||
Bail out! # test unfinished | ||
Error: TAP teardown | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
{ name: 'TAP', autoend: true, test: 'TAP' } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
TAP version 13 | ||
# Subtest: child | ||
not ok 1 - test unfinished | ||
--- | ||
{"at":{"column":3,"file":"test/test/teardown-throw-autocomplete.js","line":10},"source":"t.test('child', function (t) {\n","test":"child"} | ||
... | ||
|
||
Bail out! # test unfinished | ||
Bail out! # test unfinished | ||
Error: TAP teardown | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
{ name: 'TAP', autoend: true, test: 'TAP' } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
TAP version 13 | ||
not ok 1 - child ___/# time=[0-9.]+(ms)?/~~~ { | ||
not ok 1 - test unfinished | ||
--- | ||
{"at":{"column":3,"file":"test/test/teardown-throw-autocomplete.js","line":10},"source":"t.test('child', function (t) {\n","test":"child"} | ||
... | ||
|
||
not ok 2 - afterEach | ||
--- | ||
{"at":{"column":9,"file":"test/test/teardown-throw-autocomplete.js","line":7},"source":"throw new Error('afterEach')\n","test":"child"} | ||
... | ||
|
||
1..2 | ||
# failed 2 of 2 tests | ||
} | ||
|
||
not ok 2 - child teardown | ||
--- | ||
{"at":{"column":11,"file":"test/test/teardown-throw-autocomplete.js","line":12},"autoend":true,"source":"throw new Error('child teardown')\n","test":"TAP"} | ||
... | ||
|
||
1..2 | ||
# failed 2 of 2 tests | ||
___/# time=[0-9.]+(ms)?/~~~ | ||
Error: TAP teardown | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
{ name: 'TAP', autoend: true, test: 'TAP' } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
console.error = console.log | ||
var t = require('../..') | ||
t.tearDown(function () { | ||
throw new Error('TAP teardown') | ||
}) | ||
t.afterEach(function (cb) { | ||
throw new Error('afterEach') | ||
cb() | ||
}) | ||
t.test('child', function (t) { | ||
t.tearDown(function () { | ||
throw new Error('child teardown') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
TAP version 13 | ||
# Subtest: child | ||
not ok 1 - test unfinished | ||
--- | ||
{"at":{"column":3,"file":"test/test/teardown-throw-autocomplete.js","line":10},"source":"t.test('child', function (t) {\n","test":"child"} | ||
... | ||
|
||
not ok 2 - afterEach | ||
--- | ||
{"at":{"column":9,"file":"test/test/teardown-throw-autocomplete.js","line":7},"source":"throw new Error('afterEach')\n","test":"child"} | ||
... | ||
|
||
1..2 | ||
# failed 2 of 2 tests | ||
not ok 1 - child ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
not ok 2 - child teardown | ||
--- | ||
{"at":{"column":11,"file":"test/test/teardown-throw-autocomplete.js","line":12},"autoend":true,"source":"throw new Error('child teardown')\n","test":"TAP"} | ||
... | ||
|
||
1..2 | ||
# failed 2 of 2 tests | ||
___/# time=[0-9.]+(ms)?/~~~ | ||
Error: TAP teardown | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
___/^ at .*?:[0-9]+:[0-9]+\)?$/~~~ | ||
{ name: 'TAP', autoend: true, test: 'TAP' } | ||
|