Skip to content

Commit ac212ba

Browse files
yovasx2novemberborn
authored andcommittedJun 10, 2019
Include all (beautified) stack trace lines in TAP reporter output
1 parent 486acaf commit ac212ba

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed
 

‎lib/reporters/tap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function dumpError(error) {
4141
}
4242

4343
if (error.stack) {
44-
obj.at = error.stack.split('\n')[0];
44+
obj.at = error.stack;
4545
}
4646

4747
return obj;

‎test/reporters/tap.regular.log

+25-7
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ not ok 10 - traces-in-t-throws › throws
5757
message: 'uh-oh',
5858
}
5959
'Expected instance of:': 'Function TypeError {}'
60-
at: 'throwError (traces-in-t-throws.js:4:8)'
60+
at: |-
61+
throwError (traces-in-t-throws.js:4:8)
62+
throwError (traces-in-t-throws.js:12:17)
63+
throws (traces-in-t-throws.js:12:4)
6164
...
6265
---tty-stream-chunk-separator
6366
# traces-in-t-throws › notThrows
@@ -70,7 +73,10 @@ not ok 11 - traces-in-t-throws › notThrows
7073
Error {
7174
message: 'uh-oh',
7275
}
73-
at: 'throwError (traces-in-t-throws.js:4:8)'
76+
at: |-
77+
throwError (traces-in-t-throws.js:4:8)
78+
throwError (traces-in-t-throws.js:16:20)
79+
notThrows (traces-in-t-throws.js:16:4)
7480
...
7581
---tty-stream-chunk-separator
7682
# traces-in-t-throws › notThrowsAsync
@@ -83,7 +89,10 @@ not ok 12 - traces-in-t-throws › notThrowsAsync
8389
Error {
8490
message: 'uh-oh',
8591
}
86-
at: 'throwError (traces-in-t-throws.js:4:8)'
92+
at: |-
93+
throwError (traces-in-t-throws.js:4:8)
94+
throwError (traces-in-t-throws.js:20:25)
95+
notThrowsAsync (traces-in-t-throws.js:20:4)
8796
...
8897
---tty-stream-chunk-separator
8998
# traces-in-t-throws › throwsAsync
@@ -96,7 +105,10 @@ not ok 13 - traces-in-t-throws › throwsAsync
96105
Error {
97106
message: 'uh-oh',
98107
}
99-
at: 'throwError (traces-in-t-throws.js:4:8)'
108+
at: |-
109+
throwError (traces-in-t-throws.js:4:8)
110+
throwError (traces-in-t-throws.js:24:22)
111+
throwsAsync (traces-in-t-throws.js:24:4)
100112
...
101113
---tty-stream-chunk-separator
102114
# traces-in-t-throws › throwsAsync different error
@@ -110,7 +122,9 @@ not ok 14 - traces-in-t-throws › throwsAsync different erro
110122
message: 'uh-oh',
111123
}
112124
'Expected instance of:': 'Function TypeError {}'
113-
at: 'returnRejectedPromise (traces-in-t-throws.js:8:24)'
125+
at: |-
126+
returnRejectedPromise (traces-in-t-throws.js:8:24)
127+
throwsAsync (traces-in-t-throws.js:28:11)
114128
...
115129
---tty-stream-chunk-separator
116130
stdout
@@ -192,7 +206,9 @@ not ok 24 - test › bad throws
192206
Error {
193207
message: 'err',
194208
}
195-
at: 'fn (test.js:35:9)'
209+
at: |-
210+
fn (test.js:35:9)
211+
fn (test.js:38:11)
196212
...
197213
---tty-stream-chunk-separator
198214
# test › bad notThrows
@@ -206,7 +222,9 @@ not ok 25 - test › bad notThrows
206222
Error {
207223
message: 'err',
208224
}
209-
at: 'fn (test.js:43:9)'
225+
at: |-
226+
fn (test.js:43:9)
227+
fn (test.js:46:14)
210228
...
211229
---tty-stream-chunk-separator
212230
# test › implementation throws non-error

0 commit comments

Comments
 (0)
Please sign in to comment.