Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: log if npm deprecate does not match any version #7474

Merged
merged 4 commits into from
May 6, 2024

Conversation

mbtools
Copy link
Contributor

@mbtools mbtools commented May 5, 2024

Let's try again. If the package specification does not match any existing version, a verbose message is added to the log.

References

Ref #7472
Closes #7180

If the package specification does not match any existing version, a verbose message is added to the log.

## References

Ref npm#7472
Closes npm#7180
@mbtools mbtools requested a review from a team as a code owner May 5, 2024 20:44
@wraithgar wraithgar changed the title chore: log if npm deprecate does not match any version fix: log if npm deprecate does not match any version May 5, 2024
@wraithgar
Copy link
Member

wraithgar commented May 5, 2024

We have a test that covers this code path

t.test('does nothing if version does not actually exist', async t => {

You can see in another test how we can import logs from the npm test object

const { npm, logs } = await mockNpm(t, {

And then we can assert that this logging message happened

t.equal(logs.warn[0], 'init canceled', 'should have init title and canceled')

@mbtools
Copy link
Contributor Author

mbtools commented May 6, 2024

Always pays to test even for small changes 😃

@wraithgar wraithgar merged commit ca1a68d into npm:latest May 6, 2024
23 checks passed
@github-actions github-actions bot mentioned this pull request May 6, 2024
@mbtools mbtools deleted the deprecate_log branch May 27, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Running npm deprecate package@version "reason" silently fails when no versions match
2 participants