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 source file is imported using alias the vitenode.fetchCache does not contain full path. This gets filtered out in coverage provider.
import{addThreeNumbers}from"src/logic/utils";// fetchCache contains entry for "src/logic/utils"
import{addThreeNumbers}from"../../logic/utils";// fetchCache contains entry for "/x/y/z/repro/src/logic/utils.ts" - Includes the extension and full path
Describe the bug
I have a file called
utils.ts
in the foldersrc/logic/utils.ts
that has a simple function that adds three numbers.in the folder
src/__tests__/unit/utils.test.ts
I have a test for this sum function.My vitest.config.ts file looks like this
I run
vitest run --coverage
and I see that✓ src/__tests__/unit/utils.test.ts (1)
is ran butin the report
utils.ts
has 0 statements covered.Reproduction
I hope the files provided are enough to see if there is either a bug or I have a misconfiguration somewhere.
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: