Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eddyerburgh/jest-serializer-vue
Jest Serializer for Vue components
https://github.com/eddyerburgh/jest-serializer-vue
Last synced: about 2 months ago
JSON representation
Jest Serializer for Vue components
- Host: GitHub
- URL: https://github.com/eddyerburgh/jest-serializer-vue
- Owner: eddyerburgh
- License: mit
- Created: 2017-09-08T07:54:17.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-07T09:21:53.000Z (5 months ago)
- Last Synced: 2024-06-20T22:07:32.541Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 301 KB
- Stars: 62
- Watchers: 3
- Forks: 22
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# jest-serializer-vue
Jest Vue snapshot serializer
## Installation
```
npm install --save-dev jest-serializer-vue
```## Usage
You need to tell Jest to use the serializer. Add this to your Jest config:
```
"snapshotSerializers": [
"/node_modules/jest-serializer-vue"
]
```And your snapshot tests will be pretty printed 💅
```js
import { shallowMount } from '@vue/test-utils'
import Basic from './Basic.vue'describe('Basic.vue', () => {
it('renders correctly', () => {
const wrapper = shallowMount(Basic)
expect(wrapper).toMatchSnapshot()
})
})
```