-
-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle unhandledRejection as a root TAP error
- Loading branch information
Showing
6 changed files
with
55 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
TAP version 13 | ||
# this is fine | ||
not ok 1 - 💩 | ||
--- | ||
{"at":{"column":30,"constructor":true,"file":"test/test/unhandled-rejection.js","line":9},"source":"this.dump = Promise.reject(new Error('💩'))\n","test":"TAP"} | ||
... | ||
|
||
Bail out! # 💩 | ||
|
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,9 @@ | ||
TAP version 13 | ||
# this is fine | ||
not ok 1 - 💩 | ||
--- | ||
{"at":{"column":30,"constructor":true,"file":"test/test/unhandled-rejection.js","line":9},"source":"this.dump = Promise.reject(new Error('💩'))\n","test":"TAP"} | ||
... | ||
|
||
Bail out! # 💩 | ||
|
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,11 @@ | ||
TAP version 13 | ||
# this is fine | ||
not ok 1 - 💩 | ||
--- | ||
{"at":{"column":30,"constructor":true,"file":"test/test/unhandled-rejection.js","line":9},"source":"this.dump = Promise.reject(new Error('💩'))\n","test":"TAP"} | ||
... | ||
|
||
1..1 | ||
# failed 1 test | ||
___/# time=[0-9.]+(ms)?/~~~ | ||
|
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,12 @@ | ||
if (typeof Promise === 'undefined') | ||
Promise = require('bluebird') | ||
|
||
var tap = require('../..') | ||
tap.comment('this is fine') | ||
|
||
function Poo () { | ||
// Initially set the loaded status to a rejected promise | ||
this.dump = Promise.reject(new Error('💩')) | ||
} | ||
|
||
new Poo() |
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,11 @@ | ||
TAP version 13 | ||
# this is fine | ||
not ok 1 - 💩 | ||
--- | ||
{"at":{"column":30,"constructor":true,"file":"test/test/unhandled-rejection.js","line":9},"source":"this.dump = Promise.reject(new Error('💩'))\n","test":"TAP"} | ||
... | ||
|
||
1..1 | ||
# failed 1 test | ||
___/# time=[0-9.]+(ms)?/~~~ | ||
|