jest-serializer-vue
A jest serializer for Vue snapshots
Last updated 7 years ago by eddyerburgh .
MIT · Repository · Bugs · Original npm
$ cnpm install jest-serializer-vue 
SYNC missed versions from official npm registry.

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 { shallow } from 'avoriaz'
import Basic from './Basic.vue'
import { createRenderer } from 'vue-server-renderer'

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

Current Tags

  • 2.0.2                                ...           latest (7 years ago)

3 Versions

  • 2.0.2                                ...           7 years ago
  • 0.3.0                                ...           8 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org