Zhouyiping 5a7c95461a first commit před 2 dny
..
.circleci 5a7c95461a first commit před 2 dny
test 5a7c95461a first commit před 2 dny
.babelrc 5a7c95461a first commit před 2 dny
.eslintrc 5a7c95461a first commit před 2 dny
CHANGELOG.md 5a7c95461a first commit před 2 dny
LICENSE 5a7c95461a first commit před 2 dny
README.md 5a7c95461a first commit před 2 dny
index.js 5a7c95461a first commit před 2 dny
jest.config.json 5a7c95461a first commit před 2 dny
package.json 5a7c95461a first commit před 2 dny

README.md

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