Skip to content

Commit b91ea4f

Browse files
committed
test: output env on child process error
1 parent 10b31c8 commit b91ea4f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/legacy-cli/e2e/utils/process.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,20 @@ function _exec(options: ExecOptions, cmd: string, args: string[]): Promise<Proce
115115

116116
reject(
117117
new Error(
118-
`Running "${cmd} ${args.join(
119-
' ',
120-
)}" returned error. ${error}...\n\nSTDOUT:\n${stdout}\n\nSTDERR:\n${stderr}\n`,
118+
`Running "${cmd} ${args.join(' ')}" returned error. ${error}...\n\nENV:${JSON.stringify(
119+
process.env,
120+
null,
121+
2,
122+
)}\n\nSTDOUT:\n${stdout}\n\nSTDERR:\n${stderr}\n`,
121123
),
122124
);
123125
});
124126
childProcess.on('error', (err) => {
125-
err.message += `${err}...\n\nSTDOUT:\n${stdout}\n\nSTDERR:\n${stderr}\n`;
127+
err.message += `${err}...\n\nENV:${JSON.stringify(
128+
process.env,
129+
null,
130+
4,
131+
)}\n\nSTDOUT:\n${stdout}\n\nSTDERR:\n${stderr}\n`;
126132
reject(err);
127133
});
128134

0 commit comments

Comments
 (0)