caoge c760052ff9 机车状态修改 hai 8 meses
..
.circleci c760052ff9 机车状态修改 hai 8 meses
test c760052ff9 机车状态修改 hai 8 meses
.babelrc c760052ff9 机车状态修改 hai 8 meses
.eslintrc c760052ff9 机车状态修改 hai 8 meses
CHANGELOG.md c760052ff9 机车状态修改 hai 8 meses
LICENSE c760052ff9 机车状态修改 hai 8 meses
README.md c760052ff9 机车状态修改 hai 8 meses
index.js c760052ff9 机车状态修改 hai 8 meses
jest.config.json c760052ff9 机车状态修改 hai 8 meses
package.json c760052ff9 机车状态修改 hai 8 meses

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