From 7b806bc3eaf04032516c916fdece896d0b5ef0cf Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sun, 8 May 2022 08:29:04 +0300 Subject: [PATCH] docs: add vue snapshot section in migration guide --- docs/guide/migration.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/guide/migration.md b/docs/guide/migration.md index 31a31d16686c..0a93e353af55 100644 --- a/docs/guide/migration.md +++ b/docs/guide/migration.md @@ -38,3 +38,16 @@ From Vitest v0.10.0, the callback style of declaring tests is deprecated. You ca - }) + })) ``` + +**Vue Snapshots** + +This is not a Jest specific feature, but if you previously were using Jest with vue-cli preset, you will need to install [`jest-serializer-vue`](https://github.com/eddyerburgh/jest-serializer-vue) package, and use it inside [setupFiles](/config/#setupfiles): + +```ts +import vueSnapshotSerializer from 'jest-serializer-vue' + +// Add Snapshot Serializer +expect.addSnapshotSerializer(vueSnapshotSerializer) +``` + +Otherwise your snapshots will have a lot of escaped `"` characters.