fix(test): use direct Node launcher on macOS

This commit is contained in:
morluto
2026-07-24 03:31:26 +00:00
parent 42fbbb297b
commit 13f3372a8b
3 changed files with 52 additions and 2 deletions
+24
View File
@@ -1,5 +1,6 @@
import { readFile } from "node:fs/promises";
import { describe, expect, it } from "vitest";
import { packageHopperEnvironment } from "../scripts/verify-package-environment.mjs";
describe("package installation workflows", () => {
it("runs package E2E without the retired native rebuild script", async () => {
@@ -77,4 +78,27 @@ describe("package installation workflows", () => {
expect(canary).toContain('mkdtemp(join(tmpdir(), "rea-published-canary-")');
expect(canary).toContain("cwd: canaryRoot");
});
it("uses direct Node ownership on macOS and Windows", () => {
const root = "/tmp/rea-package";
const expected = {
HOPPER_LAUNCHER_PATH: process.execPath,
HOPPER_LOADER_ARGS_JSON: JSON.stringify([
`${root}/tests/fixtures/fakeLauncher.mjs`,
]),
};
expect(packageHopperEnvironment(root, "darwin")).toEqual(expected);
expect(packageHopperEnvironment(root, "win32")).toEqual(expected);
expect(packageHopperEnvironment(root, "linux")).toEqual({
HOPPER_LAUNCHER_PATH: "/bin/sh",
HOPPER_LOADER_ARGS_JSON: JSON.stringify([
"-c",
'node_path=$1; shift; "$node_path" "$@"',
"rea-package-hopper",
process.execPath,
`${root}/tests/fixtures/fakeLauncher.mjs`,
]),
});
});
});