Skip to content

Commit

Permalink
Include all (beautified) stack trace lines in TAP reporter output
Browse files Browse the repository at this point in the history
  • Loading branch information
yovasx2 authored and novemberborn committed Jun 10, 2019
1 parent 486acaf commit ac212ba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/reporters/tap.js
Expand Up @@ -41,7 +41,7 @@ function dumpError(error) {
}

if (error.stack) {
obj.at = error.stack.split('\n')[0];
obj.at = error.stack;
}

return obj;
Expand Down
32 changes: 25 additions & 7 deletions test/reporters/tap.regular.log
Expand Up @@ -57,7 +57,10 @@ not ok 10 - traces-in-t-throws › throws
message: 'uh-oh',
}
'Expected instance of:': 'Function TypeError {}'
at: 'throwError (traces-in-t-throws.js:4:8)'
at: |-
throwError (traces-in-t-throws.js:4:8)
throwError (traces-in-t-throws.js:12:17)
throws (traces-in-t-throws.js:12:4)
...
---tty-stream-chunk-separator
# traces-in-t-throws › notThrows
Expand All @@ -70,7 +73,10 @@ not ok 11 - traces-in-t-throws › notThrows
Error {
message: 'uh-oh',
}
at: 'throwError (traces-in-t-throws.js:4:8)'
at: |-
throwError (traces-in-t-throws.js:4:8)
throwError (traces-in-t-throws.js:16:20)
notThrows (traces-in-t-throws.js:16:4)
...
---tty-stream-chunk-separator
# traces-in-t-throws › notThrowsAsync
Expand All @@ -83,7 +89,10 @@ not ok 12 - traces-in-t-throws › notThrowsAsync
Error {
message: 'uh-oh',
}
at: 'throwError (traces-in-t-throws.js:4:8)'
at: |-
throwError (traces-in-t-throws.js:4:8)
throwError (traces-in-t-throws.js:20:25)
notThrowsAsync (traces-in-t-throws.js:20:4)
...
---tty-stream-chunk-separator
# traces-in-t-throws › throwsAsync
Expand All @@ -96,7 +105,10 @@ not ok 13 - traces-in-t-throws › throwsAsync
Error {
message: 'uh-oh',
}
at: 'throwError (traces-in-t-throws.js:4:8)'
at: |-
throwError (traces-in-t-throws.js:4:8)
throwError (traces-in-t-throws.js:24:22)
throwsAsync (traces-in-t-throws.js:24:4)
...
---tty-stream-chunk-separator
# traces-in-t-throws › throwsAsync different error
Expand All @@ -110,7 +122,9 @@ not ok 14 - traces-in-t-throws › throwsAsync different erro
message: 'uh-oh',
}
'Expected instance of:': 'Function TypeError {}'
at: 'returnRejectedPromise (traces-in-t-throws.js:8:24)'
at: |-
returnRejectedPromise (traces-in-t-throws.js:8:24)
throwsAsync (traces-in-t-throws.js:28:11)
...
---tty-stream-chunk-separator
stdout
Expand Down Expand Up @@ -192,7 +206,9 @@ not ok 24 - test › bad throws
Error {
message: 'err',
}
at: 'fn (test.js:35:9)'
at: |-
fn (test.js:35:9)
fn (test.js:38:11)
...
---tty-stream-chunk-separator
# test › bad notThrows
Expand All @@ -206,7 +222,9 @@ not ok 25 - test › bad notThrows
Error {
message: 'err',
}
at: 'fn (test.js:43:9)'
at: |-
fn (test.js:43:9)
fn (test.js:46:14)
...
---tty-stream-chunk-separator
# test › implementation throws non-error
Expand Down

0 comments on commit ac212ba

Please sign in to comment.