jest-serializer-vue

3.1.0 • Public • Published

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": [
  "<rootDir>/node_modules/jest-serializer-vue"
]

And your snapshot tests will be pretty printed 💅

import { shallowMount } from '@vue/test-utils'
import Basic from './Basic.vue'

describe('Basic.vue', () => {
  it('renders correctly', () => {
    const wrapper = shallowMount(Basic)
    expect(wrapper).toMatchSnapshot()
  })
})

Readme

Keywords

Package Sidebar

Install

npm i jest-serializer-vue

Weekly Downloads

384,250

Version

3.1.0

License

MIT

Unpacked Size

13.7 kB

Total Files

23

Last publish

Collaborators

  • eddyerburgh