File tree 1 file changed +8
-11
lines changed
1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -43,22 +43,19 @@ describe("UnexpectedError", () => {
43
43
const cause = new Error ( "Whoops!" ) ;
44
44
45
45
const error = new UnexpectedError ( cause ) ;
46
- const rendered = error . sprint ( ) ;
47
-
48
- expect ( rendered . replace ( / a t .* n o d e _ m o d u l e s .* $ / gm, "at ..." ) ) . toMatchInlineSnapshot ( `
46
+ const rendered = error
47
+ . sprint ( )
48
+ // replace node_module stack lines with "at ..."
49
+ . replace ( / a t .* n o d e _ m o d u l e s .* $ / gm, "at ..." )
50
+ // replace sequential "at ..." lines into a single line
51
+ . replace ( / a t \. \. \. ( \n \s * a t \. \. \. ) + / g, "at ..." ) ;
52
+
53
+ expect ( rendered ) . toMatchInlineSnapshot ( `
49
54
"An unexpected error occurred.
50
55
51
56
Error: Whoops!
52
57
at spec/services/output/report.spec.ts:43:19
53
58
at ...
54
- at ...
55
- at ...
56
- at ...
57
- at ...
58
- at ...
59
- at ...
60
- at ...
61
- at ...
62
59
63
60
This is a bug, use the link below to create an issue on GitHub.
64
61
You can’t perform that action at this time.
0 commit comments