-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: log if
npm deprecate
does not match any version (#7474)
If the package specification does not match any existing version, a warning message is added to the log. ## References Ref #7472 Closes #7180
- Loading branch information
Showing
2 changed files
with
5 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 |
---|---|---|
|
@@ -155,7 +155,7 @@ t.test('deprecates all versions when no range is specified', async t => { | |
}) | ||
|
||
t.test('does nothing if version does not actually exist', async t => { | ||
const { npm, joinedOutput } = await loadMockNpm(t, { config: { ...auth } }) | ||
const { npm, logs, joinedOutput } = await loadMockNpm(t, { config: { ...auth } }) | ||
const registry = new MockRegistry({ | ||
tap: t, | ||
registry: npm.config.get('registry'), | ||
|
@@ -168,4 +168,5 @@ t.test('does nothing if version does not actually exist', async t => { | |
await registry.package({ manifest, query: { write: true } }) | ||
await npm.exec('deprecate', ['[email protected]', 'this should be ignored']) | ||
t.match(joinedOutput(), '') | ||
t.equal(logs.warn[0], 'deprecate No version found for 1.0.99') | ||
}) |