What could be the issue when trying to use the jest update snapshot
command with the -u
or --updateSnapshot
flags in my npm run test
command?
I’m trying to add the -u
parameter to update my Jest snapshots, like this:
npm run test ComponentName.spec.js -u
or:
npm run test ComponentName.spec.js --updateSnapshot
However, it’s not working. Here’s my package.json script setup:
"scripts": {
"test": "vue-cli-service test:unit"
}
I know I can delete the snapshot files manually, but I’d like to figure out why this command isn’t working as expected.