Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(publish): Short-circuit retries for npm username validation
- Loading branch information
Showing
5 changed files
with
30 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,6 @@ | ||
"use strict"; | ||
|
||
const registry = new Map(); | ||
|
||
// to mock user modules, you _must_ call `jest.mock('./path/to/module')` | ||
const mockGetNpmUsername = jest.fn(opts => { | ||
registry.set(opts.prefix, opts); | ||
|
||
return Promise.resolve("lerna-test"); | ||
}); | ||
|
||
// keep test data isolated | ||
afterEach(() => { | ||
registry.clear(); | ||
}); | ||
const mockGetNpmUsername = jest.fn(() => Promise.resolve("lerna-test")); | ||
|
||
module.exports = mockGetNpmUsername; | ||
module.exports.registry = registry; |
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