How to update snapshot with Jest and vue-cli
Based on the docs:
npm run test -- -u
I verified this works.
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.
yarn test -u
worked for me. We use yarn.