-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@pvm/plugin-core): partially failed publish now throws error
Closes #21
- Loading branch information
Showing
7 changed files
with
166 additions
and
34 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
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 |
---|---|---|
|
@@ -295,6 +295,32 @@ describe('pvm/publish', () => { | |
expect(pkgs.find(p => p.pkg === 'c').publishedVersion).toBe('0.44.1') | ||
}) | ||
|
||
it('publish command should fail if some packages failed to publish', async () => { | ||
const repoPath = writeRepo({ name: 'invalid-publish-registry', spec: 'src/[email protected],src/[email protected]' }) | ||
const repo = await initRepo(repoPath) | ||
|
||
await repo.updatePkg('src/b', { | ||
publishConfig: { | ||
registry: 'invalid', | ||
}, | ||
}) | ||
|
||
await expect(() => testPublish(repo, '-s all')).rejects.toBeTruthy() | ||
}) | ||
|
||
it('publish with --bail flag should fail if some packages failed to publish', async () => { | ||
const repoPath = writeRepo({ name: 'invalid-publish-registry', spec: 'src/[email protected],src/[email protected]' }) | ||
const repo = await initRepo(repoPath) | ||
|
||
await repo.updatePkg('src/b', { | ||
publishConfig: { | ||
registry: 'invalid', | ||
}, | ||
}) | ||
|
||
await expect(() => testPublish(repo, '-s all --bail')).rejects.toBeTruthy() | ||
}) | ||
|
||
describe('canary', () => { | ||
let slackMocker | ||
beforeAll(async () => { | ||
|