vue-test-utils-jest-example
vue-test-utils-jest-example copied to clipboard
Lines in coverage report are incorrect
// List.spec.js
describe('List.vue', () => {
it('renders li for each item in props.items', () => {
// const items = ['', '']
// const wrapper = shallow(List, {
// propsData: { items }
// })
// expect(wrapper.findAll('li')).toHaveLength(items.length)
})
})
![](https://user-images.githubusercontent.com/6647633/30592117-2d06c3cc-9d0b-11e7-9469-9f916a9e21f6.png)
![](https://user-images.githubusercontent.com/6647633/30592024-d49abc34-9d0a-11e7-86a8-ce9eabfc5bdf.png)
Try adding "mapCoverage": true
to the jest
field in package.json. Like this - https://github.com/eddyerburgh/jest-vue/blob/master/package.json#L73
Seems it's ok in this repo, but not in my own library repo :/ Let me try again later.
I met some bugs when doing coverage with jest in vue, now I switched back to karma/mocha/phantomjs.
Waiting for more progress on vue-test-utils.
Can you report bugs to https://github.com/eddyerburgh/jest-vue?