尝试使用这些说明将此项目转换为玩笑。除了使用配置的文件外,我一切正常:paths
"paths": {
"@fs/*": ["./src/*"],
"@test/*": ["./test/*"]
}
看起来好像在运行测试时导入语句没有解析,并且记录如下:
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)
有没有办法让 jest/ts-jest@paths
在解析导入时包含在内?