4 Replies
It's true that Vitest's V8 test coverage uses the native test coverage capability of V8, the JavaScript engine. However, Istanbul accomplishes the same thing by instrumenting the code as it's compiled. Since Vitest is doing the compilation this is accomplished with a single bit of configuration.
https://developers.cloudflare.com/workers/testing/vitest-integration/known-issues/#coverage
It's true that V8 coverage has more raw performance. However, V8 gathers coverage information on your code and all the library code that is executed. The reporting mechanism just throws out the data unrelated to your code. Istanbul, on the other hand only instruments your code to begin with so only that data is gathered. These two tend to cancel each other out so I don't notice a difference in peformance. I do notice however, that the Istanbul coverage is a bit more precise around conditionals and loops.
Did you just asked LLM for arguments and directly copied the response here?
No LLM involved
I've just played with both in the project I'm currently working on and because DOs only works with Istanbul, I had to switch everything over to that so I don't have to have a bunch of different test configs.