Skip to content

Commit 602780a

Browse files
committed
rename to just result, that's all the error is, stay with result
1 parent cab12c4 commit 602780a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tests/integration/exec-utils.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ describe("execFileWithInput integration tests", () => {
2222
try {
2323
await execFileWithInput("bash", "nonexistentcommand", {});
2424
fail("Should have thrown an error");
25-
} catch (error: any) {
26-
// console.log(error);
27-
expect(error.stderr).toContain("bash: line 1: nonexistentcommand: command not found");
28-
expect(error.message).toContain("Command failed: bash\nbash: line 1: nonexistentcommand: command not found\n");
25+
} catch (result: any) {
26+
// console.log(result);
27+
expect(result.stderr).toContain("bash: line 1: nonexistentcommand: command not found");
28+
expect(result.message).toContain("Command failed: bash\nbash: line 1: nonexistentcommand: command not found\n");
2929
}
3030
});
3131

@@ -45,10 +45,10 @@ describe("execFileWithInput integration tests", () => {
4545
try {
4646
await execFileWithInput("fish", "totallynonexistentcommand", {});
4747
fail("Should have thrown an error");
48-
} catch (error: any) {
49-
// console.log(error)
50-
expect(error.stderr).toContain("fish: Unknown command: totallynonexistentcommand\nfish: \ntotallynonexistentcommand\n^~~~~~~~~~~~~~~~~~~~~~~~^");
51-
expect(error.message).toBeTruthy();
48+
} catch (result: any) {
49+
// console.log(result);
50+
expect(result.stderr).toContain("fish: Unknown command: totallynonexistentcommand\nfish: \ntotallynonexistentcommand\n^~~~~~~~~~~~~~~~~~~~~~~~^");
51+
expect(result.message).toBeTruthy();
5252
}
5353
});
5454

@@ -67,12 +67,12 @@ describe("execFileWithInput integration tests", () => {
6767
try {
6868
await execFileWithInput("zsh", "completelynonexistentcommand", {});
6969
fail("Should have thrown an error");
70-
} catch (error: any) {
71-
// console.log(error)
70+
} catch (result: any) {
71+
// console.log(result);
7272
// TODO why am I not reporting the exit code?! ==> 127 here (and in other cases above for missing command)
73-
expect(error.stderr).toContain("zsh: command not found: completelynonexistentcommand");
73+
expect(result.stderr).toContain("zsh: command not found: completelynonexistentcommand");
7474
// TODO why am I bothering to return message... it seems to just duplicate STDERR?!
75-
expect(error.message).toBeTruthy();
75+
expect(result.message).toBeTruthy();
7676
}
7777
});
7878

0 commit comments

Comments
 (0)