From 3043070b0dd173ef012baa5fcd205d38c7dadc72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Thu, 13 Aug 2026 00:50:23 +0000 Subject: [PATCH] Prevent test warning annotations (#720) --- src/run.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/run.test.ts b/src/run.test.ts index 8f3f4eb..42299c9 100644 --- a/src/run.test.ts +++ b/src/run.test.ts @@ -22,8 +22,12 @@ vi.mock("@actions/github", () => ({ graphql: mockedGraphql, }), })); -vi.mock("@actions/core", { spy: true }); -const mockedWarning = vi.mocked(core.warning); +vi.mock("@actions/core", async (importOriginal) => ({ + ...(await importOriginal()), + error: vi.fn(), + notice: vi.fn(), + warning: vi.fn(), +})); vi.mock("@changesets/ghcommit"); let mockedGithubMethods = { @@ -133,7 +137,7 @@ describe("publish", () => { }); expect(result).toEqual({ published: false, exitCode: 0 }); - expect(mockedWarning).toHaveBeenCalledWith( + expect(core.warning).toHaveBeenCalledWith( expect.stringContaining( "GitHub releases and git tags cannot be created without this output", ),