Skip to content

Commit

Permalink
docs: Make Vue snapshot migration clear (#2379)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJaredWilcurt committed Nov 29, 2022
1 parent 824e18c commit a6a94cc
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions docs/guide/migration.md
Expand Up @@ -81,10 +81,23 @@ Vitest doesn't support Jest's legacy timers.

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
`vite.config.js`

```js
import { defineConfig } from 'vite'

export default defineConfig({
test: {
setupFiles: ['./tests/unit/setup.js']
}
})
```

`tests/unit/setup.js`

```js
import vueSnapshotSerializer from 'jest-serializer-vue'

// Add Snapshot Serializer
expect.addSnapshotSerializer(vueSnapshotSerializer)
```

Expand Down

0 comments on commit a6a94cc

Please sign in to comment.