| 
				
					 | 
			1 year ago | |
|---|---|---|
| .. | ||
| .circleci | 1 year ago | |
| test | 1 year ago | |
| .babelrc | 1 year ago | |
| .eslintrc | 1 year ago | |
| CHANGELOG.md | 1 year ago | |
| LICENSE | 1 year ago | |
| README.md | 1 year ago | |
| index.js | 1 year ago | |
| jest.config.json | 1 year ago | |
| package.json | 1 year ago | |
Jest Vue snapshot serializer
npm install --save-dev jest-serializer-vue
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()
  })
})