Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(publish): Add
--legacy-auth
flag (#2347)
Passed as `_auth` internally because that is what NPM expects.
- Loading branch information
Showing
5 changed files
with
70 additions
and
0 deletions.
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
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
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,39 @@ | ||
"use strict"; | ||
|
||
const path = require("path"); | ||
|
||
const cliRunner = require("@lerna-test/cli-runner"); | ||
const cloneFixture = require("@lerna-test/clone-fixture")( | ||
path.resolve(__dirname, "../commands/publish/__tests__") | ||
); | ||
|
||
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 --legacy-auth", async () => { | ||
const { cwd } = await cloneFixture("normal"); | ||
const data = "hi:mom"; | ||
const auth = Buffer.from(data).toString("base64"); | ||
const args = ["publish", "patch", "--yes", "--legacy-auth", auth]; | ||
|
||
const { stdout } = await cliRunner(cwd, env)(...args); | ||
expect(stdout).toMatchInlineSnapshot(` | ||
Changes: | ||
- package-1: 1.0.0 => 1.0.1 | ||
- package-2: 1.0.0 => 1.0.1 | ||
- package-3: 1.0.0 => 1.0.1 | ||
- package-4: 1.0.0 => 1.0.1 | ||
- package-5: 1.0.0 => 1.0.1 (private) | ||
Successfully published: | ||
- package-1@1.0.1 | ||
- package-2@1.0.1 | ||
- package-3@1.0.1 | ||
- package-4@1.0.1 | ||
`); | ||
}); |