Skip to content

Commit 0fbce86

Browse files
committed
test(vitest-plugin): derive expected v8 flags from getV8Flags
The hardcoded flag list broke on Node 24, which adds --no-maglev; asserting the plugin wiring instead of duplicating the version-dependent flag list keeps the test valid across Node majors.
1 parent 622876f commit 0fbce86

1 file changed

Lines changed: 3 additions & 24 deletions

File tree

‎packages/vitest-plugin/src/__tests__/index.test.ts‎

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { fromPartial } from "@total-typescript/shoehorn";
2+
import { getV8Flags } from "@codspeed/core";
23
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
34
import codspeedPlugin from "../index";
45

@@ -113,18 +114,7 @@ describe("codSpeedPlugin", () => {
113114
expect.stringContaining("packages/vitest-plugin/src/globalSetup.ts"),
114115
],
115116
pool: "forks",
116-
execArgv: [
117-
"--interpreted-frames-native-stack",
118-
"--allow-natives-syntax",
119-
"--hash-seed=1",
120-
"--random-seed=1",
121-
"--no-opt",
122-
"--predictable",
123-
"--predictable-gc-schedule",
124-
"--expose-gc",
125-
"--no-concurrent-sweeping",
126-
"--max-old-space-size=4096",
127-
],
117+
execArgv: getV8Flags(),
128118
runner: expect.stringContaining(
129119
"packages/vitest-plugin/src/analysis.ts",
130120
),
@@ -152,18 +142,7 @@ describe("codSpeedPlugin", () => {
152142
pool: "forks",
153143
poolOptions: {
154144
forks: {
155-
execArgv: [
156-
"--interpreted-frames-native-stack",
157-
"--allow-natives-syntax",
158-
"--hash-seed=1",
159-
"--random-seed=1",
160-
"--no-opt",
161-
"--predictable",
162-
"--predictable-gc-schedule",
163-
"--expose-gc",
164-
"--no-concurrent-sweeping",
165-
"--max-old-space-size=4096",
166-
],
145+
execArgv: getV8Flags(),
167146
},
168147
},
169148
runner: expect.stringContaining(

0 commit comments

Comments
 (0)