jest-serializer-vue

A jest serializer for Vue snapshots
15,648,486 63
Install
npm install jest-serializer-vue
Latest Version:3.1.0
Vue:2
License:MIT
Last Updated:May 7, 2024
Links: GitHub  ·  npm
Maintainer: eddyerburgh

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

Related Packages

@forsakringskassan/jest-config-vue

Shareable jest configuration for vue applications

137,449 0
jest-serializer-vue-tjw

A superb jest serializer for Vue snapshots

710,835 33
vue-i18n-jest

vue-jest transformer for i18n custom blocks

97,586 7
jest-matcher-vue-test-utils

Jest matchers to test Vue components easily

8,429 34
@hankei6km/jest-mock-nuxt-content

nuxt-content mock for jest

4,295 1

Version History

Version Released License
3.1.0 MIT
3.0.0 MIT
2.0.2 MIT
2.0.1 MIT
2.0.0 MIT