You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When more than one coverage reports are generated by istanbul, when merged, they show correct coverage of the first test file.
Expected behavior
It is common practice to split tests into multiple files. It is also acceptable to have more than one routes in a worker. So, when testing different routes from different test files, I'd expect coverage to be reported correctly for all of them.
Which Cloudflare product(s) does this pertain to?
Workers Vitest Integration
What version(s) of the tool(s) are you using?
@cloudflare/vitest-pool-workers: 0.2.9, wrangler: 3.55.0, @vitest/coverage-istanbul: 1.5.3, vitest: 1.5.3
What version of Node are you using?
20.12.2
What operating system and version are you using?
Win 11
Describe the Bug
Observed behavior
When more than one coverage reports are generated by istanbul, when merged, they show correct coverage of the first test file.
Expected behavior
It is common practice to split tests into multiple files. It is also acceptable to have more than one routes in a worker. So, when testing different routes from different test files, I'd expect coverage to be reported correctly for all of them.
Steps to reproduce
Copied scaffold from fixtures/vitest-pool-workers-examples/basics-unit-integration-self
vitest.config.ts - just enable istanbul because v8 (default) is not supported
index.ts - multiple routes, that point to different ts files
a.ts
b.ts
now I want to test route
a
and routeb
from different test files:a.test.ts
b.test.ts
I use VSCode Vitest extension and "run with coverage", but should be the same from cli.
I get the following when running "all" tests
file
b.ts
shows0%
coverage, althoughb.test.ts
run and succeeded. If I run onlyb.test.ts
, then it shows100%
coverageI tried a similar setup without wrangler at all, to see if its something related to vitest only, but it worked as expected.
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered: