sumcumo / vue-datepicker

A datepicker Vue component. Compatible with Vue 2.x.
https://sumcumo.github.io/vue-datepicker/
Apache License 2.0
75 stars 22 forks source link

Update deps & use vitest #182

Closed mst101 closed 1 year ago

mst101 commented 1 year ago

Hi @MrWook - I've also been trying to update the dependencies for this project - and what a PITA it is!

Like you (I presume), I've discovered that as soon as you update node beyond v16.16.0, the lines in the coverage reports are wrong. e.g. reference is made to an uncovered statement in DateInput.vue on line 557... when that line does not exist!

It seems to be something to do with babel...

But then again, if you stay on v16.16.0, the Popup.vue, inputProps.vue, navMixin.vue reports are missing when they should be included according to the value of collectCoverageFrom in jest.config.js.

On the plus side, I've found a workaround which avoids some tests from failing when you update vue-test-utils as you have done in this branch. There seems to be a bug in the v1.14 release which causes input.trigger("focus") to stop working. Writing input.element.dispatchEvent(new Event("focus")) instead does the trick.

I don't know know how to overcome the coverage issue... Have you got any ideas? I was wondering whether switching to using vitest might help? I'll have a go...

mst101 commented 1 year ago

I was wondering whether switching to using vitest might help?

Hooray! This appears to solve the issues I was having... I'll upload a PR asap.

mst101 commented 1 year ago

OK, this PR overcomes the trouble we were having with test coverage (when updating the dependencies) by switching from jest to vitest.

You should be able to merge this into your original PR at #167 and once you've done that, continue with merging #178, #179 and #184.