Fix tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2022-11-04 08:00:55 -04:00
1 parent be89b91025
commit a222d91ade
1 file changed
+20 -12
@@ -91,7 +91,9 @@ describe("computeUnixShellEnvironment technical tests", () => {
"/bin/tcsh", "/bin/tcsh",
])("when shell is %s", (shellPath) => { ])("when shell is %s", (shellPath) => {
beforeEach(async () => { beforeEach(async () => {
unixShellEnv = computeUnixShellEnvironment(shellPath, { signal: new AbortSignal() }); const controller = new AbortController();
unixShellEnv = computeUnixShellEnvironment(shellPath, { signal: controller.signal });
await flushPromises(); await flushPromises();
}); });
@@ -101,9 +103,9 @@ describe("computeUnixShellEnvironment technical tests", () => {
[ [
"-l", "-l",
], ],
{ expect.objectContaining({
env: expectedEnv, env: expectedEnv,
}, }),
); );
}); });
@@ -189,7 +191,9 @@ describe("computeUnixShellEnvironment technical tests", () => {
"/bin/zsh", "/bin/zsh",
])("when shell is %s", (shellPath) => { ])("when shell is %s", (shellPath) => {
beforeEach(async () => { beforeEach(async () => {
unixShellEnv = computeUnixShellEnvironment(shellPath, { signal: new AbortSignal() }); const controller = new AbortController();
unixShellEnv = computeUnixShellEnvironment(shellPath, { signal: controller.signal });
await flushPromises(); await flushPromises();
}); });
@@ -200,9 +204,9 @@ describe("computeUnixShellEnvironment technical tests", () => {
"-l", "-l",
"-i", "-i",
], ],
{ expect.objectContaining({
env: expectedEnv, env: expectedEnv,
}, }),
); );
}); });
@@ -286,7 +290,9 @@ describe("computeUnixShellEnvironment technical tests", () => {
"/usr/local/bin/fish", "/usr/local/bin/fish",
])("when shell is %s", (shellPath) => { ])("when shell is %s", (shellPath) => {
beforeEach(async () => { beforeEach(async () => {
unixShellEnv = computeUnixShellEnvironment(shellPath, { signal: new AbortSignal() }); const controller = new AbortController();
unixShellEnv = computeUnixShellEnvironment(shellPath, { signal: controller.signal });
await flushPromises(); await flushPromises();
}); });
@@ -298,9 +304,9 @@ describe("computeUnixShellEnvironment technical tests", () => {
"-c", "-c",
`'/some/process/exec/path' -p '"deadbeef" + JSON.stringify(process.env) + "deadbeef"'`, `'/some/process/exec/path' -p '"deadbeef" + JSON.stringify(process.env) + "deadbeef"'`,
], ],
{ expect.objectContaining({
env: expectedEnv, env: expectedEnv,
}, }),
); );
}); });
@@ -385,7 +391,9 @@ describe("computeUnixShellEnvironment technical tests", () => {
"/usr/local/bin/pwsh-preview", "/usr/local/bin/pwsh-preview",
])("when shell is %s", (shellPath) => { ])("when shell is %s", (shellPath) => {
beforeEach(async () => { beforeEach(async () => {
unixShellEnv = computeUnixShellEnvironment(shellPath, { signal: new AbortSignal() }); const controller = new AbortController();
unixShellEnv = computeUnixShellEnvironment(shellPath, { signal: controller.signal });
await flushPromises(); await flushPromises();
}); });
@@ -395,9 +403,9 @@ describe("computeUnixShellEnvironment technical tests", () => {
[ [
"-Login", "-Login",
], ],
{ expect.objectContaining({
env: expectedEnv, env: expectedEnv,
}, }),
); );
}); });