Skip to content

Commit e049853

Browse files
authored
FIX ⚡️ Delay computation of Error stack when no cause (#4472)
1 parent ecfe987 commit e049853

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/fast-check/test/e2e/__test-helpers__/StackSanitizer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function sanitizeStack(initialMessage: string) {
66
.replace(/at [^(]*fast-check\/(packages|node_modules)(.*):\d+:\d+/g, 'at $1$2:?:?') // line for the spec file itself
77
.replace(/at (.*) \(.*fast-check\/(packages|node_modules)(.*):\d+:\d+\)/g, 'at $1 ($2$3:?:?)') // any import linked to internals of fast-check
88
.replace(/at (.*) \(.*\/(\.yarn|Yarn)\/.*\/(node_modules\/.*):\d+:\d+\)/g, 'at $1 ($3:?:?)') // reducing risks of changes on bumps: .yarn (Linux and Mac), Yarn (Windows)
9-
.replace(/at file:\/\/\/.*\/\.yarn\/.*\/(node_modules\/.*):\d+:\d+/g, 'at $1:?:?') // reducing risks of changes on bumps: .yarn (Linux and Mac), Yarn (Windows)
9+
.replace(/at file:\/\/\/.*\/(\.yarn|Yarn)\/.*\/(node_modules\/.*):\d+:\d+/g, 'at $2:?:?') // reducing risks of changes on bumps: .yarn (Linux and Mac), Yarn (Windows)
1010
.split('\n');
1111
// Drop internals of Vitest from the stack: internals of vitest, subject to regular changes and OS dependent
1212
const firstLineWithVitest = lines.findIndex((line) => line.includes('node_modules/vitest'));

0 commit comments

Comments
 (0)