问题描述
在运行ng test"命令时将 angular 7 项目转换为 angular Universal,错误为Incomplete: No specs found, , random with seed 48751
".尝试了不同的方式提及 stackoverflow,但对我没有任何作用.
convert angular 7 project into angular universal while running "ng test" command giving error as "Incomplete: No specs found, , randomized with seed 48751
".Tried different ways mention over stackoverflow but nothing work for me.
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 命令运行正常,不会出现任何问题,以便我的单元测试用例执行.
Expected output to be ng test command run properly without giving any issue so that my unit test-cases gonna execute.
推荐答案
最后经过大量实验得到解决方案.只需添加
Finally after lot of experiments got the solution.just add
`"include": [
"**/*.spec.ts",
"**/*.d.ts",
"**/*.ts"
]`
在tsconfig.spec.json"中希望这有帮助:)
in "tsconfig.spec.json" Hope this helpful :)
这篇关于ng 测试在角度通用错误“不完整:未找到规格,随机种子 48751"中失败;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!