mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Prevent test warning annotations (#720)
This commit is contained in:
+7
-3
@@ -22,8 +22,12 @@ vi.mock("@actions/github", () => ({
|
|||||||
graphql: mockedGraphql,
|
graphql: mockedGraphql,
|
||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
vi.mock("@actions/core", { spy: true });
|
vi.mock("@actions/core", async (importOriginal) => ({
|
||||||
const mockedWarning = vi.mocked(core.warning);
|
...(await importOriginal<typeof import("@actions/core")>()),
|
||||||
|
error: vi.fn(),
|
||||||
|
notice: vi.fn(),
|
||||||
|
warning: vi.fn(),
|
||||||
|
}));
|
||||||
vi.mock("@changesets/ghcommit");
|
vi.mock("@changesets/ghcommit");
|
||||||
|
|
||||||
let mockedGithubMethods = {
|
let mockedGithubMethods = {
|
||||||
@@ -133,7 +137,7 @@ describe("publish", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
expect(result).toEqual({ published: false, exitCode: 0 });
|
expect(result).toEqual({ published: false, exitCode: 0 });
|
||||||
expect(mockedWarning).toHaveBeenCalledWith(
|
expect(core.warning).toHaveBeenCalledWith(
|
||||||
expect.stringContaining(
|
expect.stringContaining(
|
||||||
"GitHub releases and git tags cannot be created without this output",
|
"GitHub releases and git tags cannot be created without this output",
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user