XuelesszzZ 94af2b8e7b 6-30-5 | il y a 1 an | |
---|---|---|
.. | ||
.circleci | il y a 1 an | |
test | il y a 1 an | |
.babelrc | il y a 1 an | |
.eslintrc | il y a 1 an | |
CHANGELOG.md | il y a 1 an | |
LICENSE | il y a 1 an | |
README.md | il y a 1 an | |
index.js | il y a 1 an | |
jest.config.json | il y a 1 an | |
package.json | il y a 1 an |
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()
})
})