rusk
rusk copied to clipboard
Gain a reliable code coverage in Svelte components
Summary
Coverage seems quite unreliable in Svelte components with vitest
, see:
- https://github.com/vitest-dev/vitest/issues/1893
- https://github.com/vitest-dev/vitest/issues/1423
Maybe experiment with istanbul
as provider instead of v8
.
A very quick experiment with istanbul
seems to indicate that we will have better coverage for event handlers and such, but many problems still remain on the markup portion of the component.
Vitest update its coverage providers (both v8 and istanbul) to v.1.x.
The situation is still puzzling; I'll attach some screenshots from the coverage of one component to illustrate the situation.
using v8 without testing the event handlers:
using v8 adding the event handlers tests:
using istanbul without testing the event handlers:
using istanbul adding the event handlers tests:
Let's keep an eye on it. Having reliable coverage would be a great boon.
This issue appears to be connected to our pain with coverage reporting... https://github.com/sveltejs/svelte/issues/7824