From 15aab45395cf1c9e3c8c0d7e50dc054931020772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Wed, 12 Aug 2026 17:59:27 +0200 Subject: [PATCH] Prevent test warning annotations --- 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 8f3f4eb0..42299c96 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", ),