Skip to content

Commit

Permalink
Allow specifying env vars in runNode() test util (#1401)
Browse files Browse the repository at this point in the history
  • Loading branch information
quasiyoke committed Jan 15, 2025
1 parent 5a3e914 commit f814299
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions utils/e2e-tests/ts/lib/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { AddCleanup } from "./cleanup";

export type RunNodeParams = {
args: string[];
env?: NodeJS.ProcessEnv | undefined;
stdio?: StdioOptions;
};

Expand Down Expand Up @@ -36,8 +37,8 @@ export const runNode = (
params: RunNodeParams,
addCleanup: AddCleanup,
): RunNodeState => {
const { args, stdio = "inherit" } = params;
const childProcess = spawn(PEER_PATH, args, { stdio });
const { args, env, stdio = "inherit" } = params;
const childProcess = spawn(PEER_PATH, args, { env, stdio });
console.log(`Spawned peer as pid ${childProcess.pid}`);

const sendSig = (sig: number) => {
Expand Down

0 comments on commit f814299

Please sign in to comment.