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
I know that this may not be an issue and its better to be asked in any stackoverflow-like media.
I already asked one.
Also I opened an issue for Awilix recently. Due to the issue I'm asking it in here.
Environment
Node.js Version: node:20.12.2-alpine
"typescript": "^5""vitest": "^1""awilix": "^8"
Actual behavior
As Awilix is using fast-glob, awilix.loadModules() doesn't load modules while creating container through my tests as it doesn't have access to the actual .ts files.
Due to my research, I couldn't find any proper solution to the problem.
I don't wanna use type: module in package.json & I can't load .ts files directly into the container. Also I'm not sure if loading .ts files into the container directly is correct.
I could fix it by:
1- Including my test directory in both tsconfig.json and my testing library config (here is my vitest.config.ts). But I'm not sure if this is correct. Due to this solution my built version of files are running tests & I believe they are for runtime only.
2- Register each module in the container manually.
I know that this may not be an issue and its better to be asked in any stackoverflow-like media.
I already asked one.
Also I opened an issue for Awilix recently. Due to the issue I'm asking it in here.
Environment
Actual behavior
As Awilix is using fast-glob, awilix.loadModules() doesn't load modules while creating container through my tests as it doesn't have access to the actual .ts files.
Due to my research, I couldn't find any proper solution to the problem.
I don't wanna use
type: module
inpackage.json
& I can't load.ts
files directly into the container. Also I'm not sure if loading.ts
files into the container directly is correct.This won't work:
I could fix it by:
1- Including my
test
directory in bothtsconfig.json
and my testing library config (here is myvitest.config.ts
). But I'm not sure if this is correct. Due to this solution my built version of files are running tests & I believe they are for runtime only.2- Register each module in the container manually.
Expected behavior
I expect the provided script auto loads modules located in the paths in both tests and production version:
I have just explained the entire process and all the code snippets related to the problem on stackoverflow.
Would you plz help me with this issue?
Thanks in advance
The text was updated successfully, but these errors were encountered: