fix: child_process test with specified shell for windows (#12926)

This commit is contained in:
Dariush Alipour
2024-07-30 01:36:46 +02:00
committed by GitHub
parent 30881444df
commit 1d9a8b4134

View File

@@ -223,7 +223,7 @@ describe("spawn()", () => {
it("should allow us to spawn in the default shell", async () => {
const shellPath: string = await new Promise(resolve => {
const child = spawn("echo", [isWindows ? "$env:SHELL" : "$SHELL"], { shell: true });
const child = spawn("echo", [isWindows ? "$PSHOME" : "$SHELL"], { shell: true });
child.stdout.on("data", data => {
resolve(data.toString().trim());
});
@@ -240,7 +240,7 @@ describe("spawn()", () => {
it("should allow us to spawn in a specified shell", async () => {
const shell = shellExe();
const shellPath: string = await new Promise(resolve => {
const child = spawn("echo", [isWindows ? "$env:SHELL" : "$SHELL"], { shell });
const child = spawn("echo", [isWindows ? "$PSHOME" : "$SHELL"], { shell });
child.stdout.on("data", data => {
resolve(data.toString().trim());
});