Skip to content

Commit

Permalink
test: snapshot env
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz committed Feb 3, 2024
1 parent 70c842c commit 7c68851
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/_runCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ export async function runCli(cwd: PortablePath, argv: Array<string>): Promise<{e
const out: Array<Buffer> = [];
const err: Array<Buffer> = [];

if (process.env.RUN_CLI_ID)
(process.env.RUN_CLI_ID as any)++;

const env = {...process.env};

return new Promise((resolve, reject) => {
if (process.env.RUN_CLI_ID)
(process.env.RUN_CLI_ID as any)++;
const child = spawn(process.execPath, [`--no-warnings`, `-r`, require.resolve(`./recordRequests.js`), require.resolve(`../dist/corepack.js`), ...argv], {
cwd: npath.fromPortablePath(cwd),
env: process.env,
env,
stdio: `pipe`,
});

Expand Down

0 comments on commit 7c68851

Please sign in to comment.