1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix computeUnixShellEnv tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-11-07 15:34:54 -05:00
parent c00b548d61
commit 6a0727b980
2 changed files with 21 additions and 5 deletions

View File

@ -133,7 +133,7 @@ const computeUnixShellEnvironmentInjectable = getInjectable({
} else {
resolve({
callWasSuccessful: false,
error: `Failed to spawn ${shellPath}: ${getErrorContext({ error })}`,
error: `Failed to spawn ${shellPath}: ${getErrorContext({ error: String(error) })}`,
});
}
});

View File

@ -127,7 +127,11 @@ describe("computeUnixShellEnvironment technical tests", () => {
it("should resolve with a failed call", async () => {
await expect(unixShellEnv).resolves.toEqual({
callWasSuccessful: false,
error: `Failed to spawn ${shellPath}: Error: some-error`,
error: `Failed to spawn ${shellPath}: ${JSON.stringify({
error: "Error: some-error",
stdout: "",
stderr: "",
}, null, 4)}`,
});
});
});
@ -229,7 +233,11 @@ describe("computeUnixShellEnvironment technical tests", () => {
it("should resolve with a failed call", async () => {
await expect(unixShellEnv).resolves.toEqual({
callWasSuccessful: false,
error: `Failed to spawn ${shellPath}: Error: some-error`,
error: `Failed to spawn ${shellPath}: ${JSON.stringify({
error: "Error: some-error",
stdout: "",
stderr: "",
}, null, 4)}`,
});
});
});
@ -330,7 +338,11 @@ describe("computeUnixShellEnvironment technical tests", () => {
it("should resolve with a failed call", async () => {
await expect(unixShellEnv).resolves.toEqual({
callWasSuccessful: false,
error: `Failed to spawn ${shellPath}: Error: some-error`,
error: `Failed to spawn ${shellPath}: ${JSON.stringify({
error: "Error: some-error",
stdout: "",
stderr: "",
}, null, 4)}`,
});
});
});
@ -430,7 +442,11 @@ describe("computeUnixShellEnvironment technical tests", () => {
it("should resolve with a failed call", async () => {
await expect(unixShellEnv).resolves.toEqual({
callWasSuccessful: false,
error: `Failed to spawn ${shellPath}: Error: some-error`,
error: `Failed to spawn ${shellPath}: ${JSON.stringify({
error: "Error: some-error",
stdout: "",
stderr: "",
}, null, 4)}`,
});
});
});