Vitest - import with alias not working Follow
It seems that after the release that support vitest, my aliased import files are not recognized anymore in my spec files only.
I have 2 different config files (which are basically almost the same):
- vite.config.ts and vitest.config.ts
In my configuration i set my vitest config file path, however it didn't solve the issue:
In my spec files aliased import are not working:
However outside my test file it works:
Please sign in to leave a comment.
Does it work if you use non-aliased path? I believe that the actual issue is that the IDE doesn't expect .vue files imports in .ts files and resolves import to d.ts shim where the corresponding module is declared
Yes it works if i don't use the alias import.
Weird. Actually it works for me when using both aliased and non-aliased imports, so it must be a configuration issue. Do you have a sample project you could share that reproduces the problem?
I fixed by updating my tsconfig.json file.
It was missing in the include property the tests folder:
Fine, thanks for letting me know!