I am currently in the process of transitioning this project to jest by following these specific instructions. Everything seems to be working fine except for the files that make use of the paths
configuration:
"paths": {
"@fs/*": ["./src/*"],
"@test/*": ["./test/*"]
}
It appears that during the execution of tests, the import statements are unable to resolve and the following error is logged:
Cannot find module '@fs/container/validation/ValidationContext' from 'Core.spec.ts'
1 | import { ValidationOptions } from "@fs/container/validation/ValidationOptions";
> 2 | import { ValidationContext } from "@fs/container/validation/ValidationContext";
| ^
3 | import { ValidationContainer } from "@fs/container/validation/ValidationContainer";
4 |
5 | import { Core1 } from "@test/core/Core1";
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:221:17)
at Object.<anonymous> (test/core/Core.spec.ts:2:1)
Is there a workaround to instruct jest/ts-jest to include the @paths
when resolving imports?