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