Няма описание

FFIB: 11e3a9652a first преди 7 години
..
build 11e3a9652a first преди 7 години
test 11e3a9652a first преди 7 години
.babelrc 11e3a9652a first преди 7 години
.eslintrc 11e3a9652a first преди 7 години
CHANGELOG.md 11e3a9652a first преди 7 години
LICENSE 11e3a9652a first преди 7 години
README.md 11e3a9652a first преди 7 години
index.js 11e3a9652a first преди 7 години
package.json 11e3a9652a first преди 7 години
yarn.lock 11e3a9652a first преди 7 години

README.md

jest-serializer-vue

Jest Vue snapshot serializer

Installation

npm istall --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('hasn\'t changed snapshot', () => {
    const renderer = createRenderer()
    const wrapper = shallow(Basic)
    renderer.renderToString(wrapper.vm, (err, str) => {
      expect(str).toMatchSnapshot()
    })
  })
})