Skip to content

Commit

Permalink
test: add missing error log
Browse files Browse the repository at this point in the history
  • Loading branch information
Barbapapazes committed Jul 9, 2024
1 parent d36c0e5 commit a87271a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ describe("runMain", () => {
.spyOn(consola, "log")
.mockImplementation(() => undefined);

const consolaErrorMock = vi
.spyOn(consola, "error")
.mockImplementation(() => undefined);

afterAll(() => {
consoleMock.mockReset();
});
Expand Down Expand Up @@ -58,6 +62,7 @@ describe("runMain", () => {

const usage = await renderUsage(command);
expect(consoleMock).toHaveBeenCalledWith(usage + "\n");
expect(consolaErrorMock).toHaveBeenCalledWith("No version specified");
});

it.each([["--help"], ["-h"]])("shows usage with flag `%s`", async (flag) => {
Expand Down

0 comments on commit a87271a

Please sign in to comment.