How to update snapshot with Jest and vue-cli How to update snapshot with Jest and vue-cli vue.js vue.js

How to update snapshot with Jest and vue-cli


In vue-cli 3, your usual npm command calls vue-cli-service and not jest anymore. Vue-cli-service will call jest for you.

Either you can run :

npm run test:unit -- -u

the -- is so that the next arguments have to be passed to the subcommand.

Or

npx vue-cli-service test:unit -u

This will run the tests and upgrade the snapshots.