Skip to content

Commit 5a60213

Browse files
committed
test(cli-v2): enhance runCommand tests with exit code handling
Updated the test suite for runCommand to ensure process.exitCode is reset to 0 after each test and after all tests have completed, improving test reliability.
1 parent a028a47 commit 5a60213

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/cli/runCommand.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import { afterEach, describe, expect, it, mock } from "bun:test";
1+
import { afterEach, afterAll, describe, expect, it, mock } from "bun:test";
22
import { runCommand } from "./runCommand";
33

44
describe("runCommand", () => {
55
afterEach(() => {
6-
process.exitCode = undefined;
6+
process.exitCode = 0;
7+
});
8+
afterAll(() => {
9+
process.exitCode = 0;
710
});
811

912
it("returns 0 on success", async () => {

0 commit comments

Comments
 (0)