vitest tsconfig path failed to load url in node js (express) #5455
Answered
by
darylescode
darylescode
asked this question in
Q&A
-
I would like to perform some unit testing in Node.js (Express) using Vitest. I'm wondering if there might be a conflict between the two, as I have installed both All my files with import paths like folder structure:
tsconfig.json
vitest.config.ts
package.json
auth.spec.ts
|
Beta Was this translation helpful? Give feedback.
Answered by
darylescode
Mar 29, 2024
Replies: 1 comment 4 replies
-
Looks like your alias didn't work, here it's my config.
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you so much! I just checked your project and aligned the structure with yours. What fixed it was moving the
tsconfig.json
file to the root folder and then addinginclude": ["./src","../vitest.config.ts"]
to it then it works.May I ask how to exclude the files following role-based naming convention such
auth.route.ts
like in the below :vitest.config.ts
it doesn't exclude the files I don't want to be included