You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(upgrade): No longer warn when upgrading a devDependency (#5606)
* fix(upgrade): No longer warn when upgrading a devDependency
fixes#4840
**Summary**
Previously the upgrade command would call add with the list of packages
to upgrade to. No "--dev"
flag would be carried over and this list would contain all dependencies.
As a result, Add would
report a warning `{package} is already in "devDependencies". Please
remove existing entry first
before adding it to "dependencies".`
I am using the existing `config.commandName` to decide whether or not to
display the warning.
I also updated the jest snapshots, because I was tired of the warning
about 40-some obsolete snapshots, so the snapshot changes here aren't
relevant to the functionality, just cleaning up.
**Test plan**
Added regression test in `__tests__/commands/upgrade.js`.
Upgrade tests now set `config.commandName` which is an existing
property, but is not normally set by tests. I wanted to set it for all
tests in `_helpers.js` but we don't actually specify the command we are
going to test when we build a test runner.
* refactor code based on PR feedback
0 commit comments