|
|
hace 3 años | |
|---|---|---|
| .. | ||
| .circleci | hace 3 años | |
| test | hace 3 años | |
| .babelrc | hace 3 años | |
| .eslintrc | hace 3 años | |
| CHANGELOG.md | hace 3 años | |
| LICENSE | hace 3 años | |
| README.md | hace 3 años | |
| index.js | hace 3 años | |
| jest.config.json | hace 3 años | |
| package.json | hace 3 años | |
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()
})
})