File tree Expand file tree Collapse file tree
packages/fast-check/test/e2e/__test-helpers__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,17 @@ function sanitizeStack(initialMessage: string) {
55 . join ( '\n' )
66 . replace ( / a t [ ^ ( ] * f a s t - c h e c k \/ ( p a c k a g e s | n o d e _ m o d u l e s ) ( .* ) : \d + : \d + / g, 'at $1$2:?:?' ) // line for the spec file itself
77 . replace ( / a t ( .* ) \( .* f a s t - c h e c k \/ ( p a c k a g e s | n o d e _ m o d u l e s ) ( .* ) : \d + : \d + \) / g, 'at $1 ($2$3:?:?)' ) // any import linked to internals of fast-check
8+ // pnpm v11 stores dependencies under a global virtual store (`.../store/v<N>/links/...`) instead of `<repo>/node_modules/.pnpm/`.
9+ // Re-shape unscoped (`@/<pkg>/<version>/<hash>`) and scoped (`@<scope>/<pkg>/<version>/<hash>`) store paths back into the v10
10+ // `node_modules/.pnpm/<flat-name>@<version>/...` form so the snapshot stays valid across pnpm versions.
11+ . replace (
12+ / a t ( .* ) \( f i l e : \/ \/ [ ^ ( ) ] + ?\/ s t o r e \/ v \d + \/ l i n k s \/ @ \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) \/ [ a - f 0 - 9 ] + \/ n o d e _ m o d u l e s \/ ( [ ^ ) ] * ?) : \d + : \d + \) / g,
13+ 'at $1 (node_modules/.pnpm/$2@$3/node_modules/$4:?:?)' ,
14+ )
15+ . replace (
16+ / a t ( .* ) \( f i l e : \/ \/ [ ^ ( ) ] + ?\/ s t o r e \/ v \d + \/ l i n k s \/ @ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) \/ [ a - f 0 - 9 ] + \/ n o d e _ m o d u l e s \/ ( [ ^ ) ] * ?) : \d + : \d + \) / g,
17+ 'at $1 (node_modules/.pnpm/@$2+$3@$4/node_modules/$5:?:?)' ,
18+ )
819 . replace ( / n o d e _ m o d u l e s \/ \. p n p m \/ ( [ ^ / ] * ) @ ( [ ^ / ] * ) \/ / g, 'node_modules/.pnpm/$1@<version>/' ) // drop version from pnpm modules
920 . split ( '\n' ) ;
1021 // Drop internals of Vitest from the stack: internals of vitest, subject to regular changes and OS dependent
You can’t perform that action at this time.
0 commit comments