gpt4 book ai didi

angular - ng测试在 Angular 通用错误 "Incomplete: No specs found, , randomized with seed 48751"中失败

转载 作者:行者123 更新时间:2023-12-03 15:49:09 30 4
gpt4 key购买 nike

在运行“ng test”命令时将angular 7项目转换为通用 Angular ,给出错误为“Incomplete: No specs found, , randomized with seed 48751”。
尝试过不同的方法来提及stackoverflow,但对我没有任何帮助。

ERROR in ./src/polyfills.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: ../src/polyfills.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (../node_modules/@ngtools/webpack/src/packages/ngtools/webpack/src/angular_compiler_plugin.ts:1024:15)
at plugin.done.then (../node_modules/@ngtools/webpack/src/packages/ngtools/webpack/src/loader.ts:49:29)
at process._tickCallback (internal/process/next_tick.js:68:7)
@ multi ./src/polyfills.ts ./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js polyfills[0]

预期输出为ng test的命令可以正常运行而不会出现任何问题,以便我的单元测试用例能够执行。

最佳答案

经过大量实验终于得到了解决方案。
只需添加

`"include": [
"**/*.spec.ts",
"**/*.d.ts",
"**/*.ts"
]`

在“tsconfig.spec.json”中希望对您有帮助:)

关于angular - ng测试在 Angular 通用错误 "Incomplete: No specs found, , randomized with seed 48751"中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57971347/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com