Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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()
})
})
```