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
This seems to cause function f to be considered not covered even when f is executed. I confirmed Vite commit right before vitejs/vite#19004 didn't have this issue.
Independently from vitejs/vite#19004, I'm trying to hoist Object.defineProperty in vitejs/vite#18983 and that seems to cause a similar missing coverage.
People usually don't write import after the export like the first case and we didn't have a test case for that, so I didn't notice it when reviewing vitejs/vite#19004. While testing my PR #7096, this just got caught because it broke the coverage test, which has this pattern (export function at the first line):
Describe the bug
related:
After vitejs/vite#19004, a following code is transformed in this way (source map vis)
input
output
This seems to cause function
f
to be considered not covered even whenf
is executed. I confirmed Vite commit right before vitejs/vite#19004 didn't have this issue.Independently from vitejs/vite#19004, I'm trying to hoist
Object.defineProperty
in vitejs/vite#18983 and that seems to cause a similar missing coverage.Transform works like this (source map vis)
input
output
People usually don't write
import
after theexport
like the first case and we didn't have a test case for that, so I didn't notice it when reviewing vitejs/vite#19004. While testing my PR #7096, this just got caught because it broke the coverage test, which has this pattern (export function
at the first line):vitest/test/coverage-test/fixtures/src/math.ts
Line 1 in 178f515
Reproduction
https://github.com/hi-ogawa/reproductions/tree/main/vitest-function-coverage-vite-19004
https://github.com/hi-ogawa/reproductions/tree/main/vitest-function-coverage-prepend-transform
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: