Validate that projects use Changesets CLI v3 and direct Changesets CLI v2 users to changesets/action@v1 (#699)

* Validate that projects use Changesets CLI v3 and direct Changesets CLI v2 users to `changesets/action@v1`

* better spy/mocking

* fmt

* shuffle
This commit is contained in:
Mateusz Burzyński
2026-07-23 09:34:32 +00:00
committed by GitHub
parent 84d78c68f9
commit 5b307d3df2
9 changed files with 143 additions and 23 deletions
+3 -5
View File
@@ -21,10 +21,8 @@ vi.mock("@actions/github", () => ({
graphql: mockedGraphql,
}),
}));
vi.mock("@actions/core", async (importOriginal) => ({
...(await importOriginal<typeof import("@actions/core")>()),
warning: vi.fn(),
}));
vi.mock("@actions/core", { spy: true });
const mockedWarning = vi.mocked(core.warning);
vi.mock("@changesets/ghcommit");
let mockedGithubMethods = {
@@ -126,7 +124,7 @@ describe("publish", () => {
});
expect(result).toEqual({ published: false, exitCode: 0 });
expect(core.warning).toHaveBeenCalledWith(
expect(mockedWarning).toHaveBeenCalledWith(
expect.stringContaining(
"GitHub releases and git tags cannot be created without this output",
),