vuejs / vue-jest

Jest Vue transformer
MIT License
746 stars 157 forks source link

fix: Map lines for script block #516

Closed wolfgangwalther closed 1 year ago

wolfgangwalther commented 1 year ago

I'm using vue2-jest and code coverage is broken for a while now. I noticed a difference between processScript in vue2-jest vs. vue3-jest:

vue2-jest:

https://github.com/vuejs/vue-jest/blob/dbe8022c59407b7474e78d2514c317685680c15e/packages/vue2-jest/lib/process.js#L35-L53

vue3-jest:

https://github.com/vuejs/vue-jest/blob/dbe8022c59407b7474e78d2514c317685680c15e/packages/vue3-jest/lib/process.js#L30-L49

The call to mapLines is missing for vue2-jest.

Adding the call, I can see two differences in the tests:

The change also made code coverage in my repo work properly again, at least I think so from the output I get.

lmiller1990 commented 1 year ago

Seems fine, thanks!

lmiller1990 commented 1 year ago

It's out in 29.2.2. https://github.com/vuejs/vue-jest/releases/tag/v29.2.2