npm install react --save --save-exact
npm install react —save-dev --save-exact
This replaces package-lock.json file with npm-shrinkwrap.json
npm shrinkwrap —-dev
notice: package-lock.json is replaced with npm-shrinkwrap.json. One key detail about package-lock.json is that it cannot be published.
The snapshot should be committed along code changes. When a snapshot test fails, you need to inspect whether it is an intended or unintended change. If the change is expected you can invoke Jest with jest -u
to overwrite the existing snapshot.