Skip to content

Commit

Permalink
chore: fix force publish released head test
Browse files Browse the repository at this point in the history
  • Loading branch information
erquhart authored and evocateur committed May 11, 2019
1 parent 46be18c commit 05e0fd7
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions commands/version/__tests__/version-command.test.js
Expand Up @@ -48,9 +48,6 @@ expect.addSnapshotSerializer(require("@lerna-test/serialize-git-sha"));

describe("VersionCommand", () => {
describe("normal mode", () => {
beforeEach(() => {
checkWorkingTree.mockReset();
});
it("versions changed packages", async () => {
const testDir = await initFixture("normal");
// when --conventional-commits is absent,
Expand Down Expand Up @@ -151,15 +148,12 @@ describe("VersionCommand", () => {
expect.assertions(1);
});

it("does not throw if current ref is already tagged when using --force-publish", async () => {
checkWorkingTree.mockImplementationOnce(() => {
throw new Error("released");
});

it("calls `checkWorkingTree.throwIfUncommitted` when using --force-publish", async () => {
const testDir = await initFixture("normal");

await lernaVersion(testDir)("--force-publish");

expect.assertions(0);
expect(checkWorkingTree.throwIfUncommitted).toHaveBeenCalled();
});

it("only bumps changed packages when non-major version selected", async () => {
Expand Down

0 comments on commit 05e0fd7

Please sign in to comment.