Skip to content

Commit 74f2657

Browse files
committed
Make "UnexpectedError renders correctly" less brittle
1 parent a42ba35 commit 74f2657

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/services/output/report.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ describe("UnexpectedError", () => {
4545
const error = new UnexpectedError(cause);
4646
const rendered = error
4747
.sprint()
48-
// replace node_module stack lines with "at ..."
49-
.replace(/at .*node_modules.*$/gm, "at ...")
48+
// replace all stack lines that don't start with "at spec" with "at ..."
49+
.replace(/at (?!spec).*$/gm, "at ...")
5050
// replace sequential "at ..." lines into a single line
5151
.replace(/at \.\.\.(\n\s*at \.\.\.)+/g, "at ...");
5252

0 commit comments

Comments
 (0)