Skip to content

Commit 3043070

Browse files
authored
Prevent test warning annotations (#720)
1 parent 3b7c71c commit 3043070

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/run.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ vi.mock("@actions/github", () => ({
2222
graphql: mockedGraphql,
2323
}),
2424
}));
25-
vi.mock("@actions/core", { spy: true });
26-
const mockedWarning = vi.mocked(core.warning);
25+
vi.mock("@actions/core", async (importOriginal) => ({
26+
...(await importOriginal<typeof import("@actions/core")>()),
27+
error: vi.fn(),
28+
notice: vi.fn(),
29+
warning: vi.fn(),
30+
}));
2731
vi.mock("@changesets/ghcommit");
2832

2933
let mockedGithubMethods = {
@@ -133,7 +137,7 @@ describe("publish", () => {
133137
});
134138

135139
expect(result).toEqual({ published: false, exitCode: 0 });
136-
expect(mockedWarning).toHaveBeenCalledWith(
140+
expect(core.warning).toHaveBeenCalledWith(
137141
expect.stringContaining(
138142
"GitHub releases and git tags cannot be created without this output",
139143
),

0 commit comments

Comments
 (0)