mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
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:
+3
-5
@@ -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",
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user