-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(publish): Ignore non-release tags when detecting
from-git
(#1782)
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"use strict"; | ||
|
||
const path = require("path"); | ||
|
||
const cliRunner = require("@lerna-test/cli-runner"); | ||
const gitTag = require("@lerna-test/git-tag"); | ||
const cloneFixture = require("@lerna-test/clone-fixture")( | ||
path.resolve(__dirname, "../commands/publish/__tests__") | ||
); | ||
|
||
// stabilize changelog commit SHA and datestamp | ||
expect.addSnapshotSerializer(require("@lerna-test/serialize-changelog")); | ||
|
||
const env = { | ||
// never actually upload when calling `npm publish` | ||
npm_config_dry_run: true, | ||
// skip npm package validation, none of the stubs are real | ||
LERNA_INTEGRATION: "SKIP", | ||
}; | ||
|
||
test("lerna publish from-git handles custom tags", async () => { | ||
const { cwd } = await cloneFixture("independent"); | ||
|
||
await gitTag(cwd, "some-unrelated-tag"); | ||
|
||
const args = ["publish", "--yes", "from-git"]; | ||
|
||
const { stdout } = await cliRunner(cwd, env)(...args); | ||
expect(stdout).toMatchInlineSnapshot("", ``); | ||
}); |