【发布时间】:2021-04-27 02:08:50
【问题描述】:
有谁知道为什么我的 Angular Jest 测试报告:
error TS2593: Cannot find name 'describe’.??
我有一个运行 Angular 应用程序和多个库的 NWL NX 工作区。
所有 Libs 中的测试运行良好。 App 中的测试都报告了这个错误。 我没有编辑配置 - 所以这些应该是 NX 设置中的配置。 我该如何解决??有什么想法吗?
应用 TsConfigs: // tsconfig.json
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"typeRoots": ["node_modules/@types"],
"types" : ["node"],
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.spec.json"
},
{
"path": "./tsconfig.editor.json"
}
]
}
// tsconfig.app.json
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"typeRoots": ["node_modules/@types"],
"types" : ["node"],
},
"files": ["src/main.ts", "src/polyfills.ts"]
}
// tsconfig.spec.json
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"files": ["src/test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}
【问题讨论】:
标签: angular typescript jestjs tsconfig angular-test