test: speed up vitest launcher startup

This commit is contained in:
Peter Steinberger
2026-04-05 13:01:37 +01:00
parent 6f5ba51f74
commit 074af3f40e
7 changed files with 92 additions and 29 deletions

View File

@@ -22,6 +22,28 @@ describe("resolvePnpmRunner", () => {
});
});
it("prepends node args when launching pnpm through node", () => {
expect(
resolvePnpmRunner({
npmExecPath: "/home/test/.cache/node/corepack/v1/pnpm/10.32.1/bin/pnpm.cjs",
nodeArgs: ["--no-maglev"],
nodeExecPath: "/usr/local/bin/node",
pnpmArgs: ["exec", "vitest", "run"],
platform: "linux",
}),
).toEqual({
command: "/usr/local/bin/node",
args: [
"--no-maglev",
"/home/test/.cache/node/corepack/v1/pnpm/10.32.1/bin/pnpm.cjs",
"exec",
"vitest",
"run",
],
shell: false,
});
});
it("falls back to bare pnpm on non-Windows when npm_execpath is missing", () => {
expect(
resolvePnpmRunner({