mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
test(package): stabilize fake Hopper ownership
This commit is contained in:
1 parent
e0bc7fd973
commit
0b7013134c
1 file changed
+20
-4
@@ -72,10 +72,7 @@ export async function verifyPackageEnvironment({
|
||||
XDG_CONFIG_HOME: join(home, ".config"),
|
||||
PATH: `${fakeBin}:${process.env.PATH ?? ""}`,
|
||||
REA_ANALYSIS_PROVIDER: "auto",
|
||||
HOPPER_LAUNCHER_PATH: process.execPath,
|
||||
HOPPER_LOADER_ARGS_JSON: JSON.stringify([
|
||||
join(root, "tests/fixtures/fakeLauncher.mjs"),
|
||||
]),
|
||||
...packageHopperEnvironment(root),
|
||||
REA_NPX_LOG: npxLog,
|
||||
REA_EVIDENCE_ROOTS_JSON: JSON.stringify([evidenceRoot]),
|
||||
REA_INVESTIGATION_INPUT_ROOTS_JSON: JSON.stringify([workspace]),
|
||||
@@ -94,3 +91,22 @@ export async function verifyPackageEnvironment({
|
||||
environment,
|
||||
};
|
||||
}
|
||||
|
||||
const packageHopperEnvironment = (root) => {
|
||||
const fakeLauncher = join(root, "tests/fixtures/fakeLauncher.mjs");
|
||||
if (process.platform === "win32")
|
||||
return {
|
||||
HOPPER_LAUNCHER_PATH: process.execPath,
|
||||
HOPPER_LOADER_ARGS_JSON: JSON.stringify([fakeLauncher]),
|
||||
};
|
||||
return {
|
||||
HOPPER_LAUNCHER_PATH: "/bin/sh",
|
||||
HOPPER_LOADER_ARGS_JSON: JSON.stringify([
|
||||
"-c",
|
||||
'node_path=$1; shift; "$node_path" "$@"',
|
||||
"rea-package-hopper",
|
||||
process.execPath,
|
||||
fakeLauncher,
|
||||
]),
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user