Skip to content

Commit 78e54c1

Browse files
committed
test(ssh): isolate remote Node fixtures from host version managers
1 parent d6063b5 commit 78e54c1

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎packages/ssh/src/tunnel.test.ts‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,24 @@ describe("ssh tunnel scripts", () => {
172172
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
173173
for (const missing of [false, true]) {
174174
const nodeFixture = missing
175-
? 'command() { [ "$*" != "-v node" ] && type "$2"; }; '
175+
? "command() { return 1; }; "
176176
: 'node() { cat >/dev/null; printf "Remote node 18.20.8 does not satisfy required range >=999.0.0.\\n" >&2; return 1; }; ';
177177
const remoteShell = ChildProcessSpawner.make((command) => {
178178
if (command._tag !== "StandardCommand") return spawner.spawn(command);
179179
return spawner.spawn(
180180
ChildProcess.make(
181181
"sh",
182182
["-c", `${nodeFixture}eval "$(cat)"`, "sh", ...commandArgs(command).slice(-1)],
183-
{ ...command.options, env: { ...command.options.env, HOME: home } },
183+
{
184+
...command.options,
185+
env: {
186+
...command.options.env,
187+
HOME: home,
188+
NVM_DIR: NodePath.join(home, ".nvm"),
189+
FNM_DIR: NodePath.join(home, ".fnm"),
190+
VOLTA_HOME: NodePath.join(home, ".volta"),
191+
},
192+
},
184193
),
185194
);
186195
});

0 commit comments

Comments
 (0)