繁体   English   中英

角度cli 6,ng测试不起作用

[英]angular cli 6, ng test not working

我刚刚将角度项目更新为角度6。

ng build和ng服务工作,但是当我使用命令运行我的测试时:

ng test

我得到输出:

Schema validation failed with the following errors:
Data path "" should have required property 'tsConfig'.

tsconfig.json:

{
"compilerOptions": {
"baseUrl": "",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
  "es2016",
  "dom"
],
"mapRoot": "./",
"module": "es2015",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
  "../node_modules/@types"
]
}
}

我究竟做错了什么 ?

我解决了 不知怎的,当我升级项目,角6 tsConfig关键是缺少测试-在>选项angular.json

为了我

  1. 在文件中:angular.json

  2. 在json节点路径:projects - > {{yourProjectName}} - > architect-> test-> options

  3. 添加节点:“tsConfig”:“src / tsconfig.json”

我是有这个问题,但它竟然是因为被添加到tsconfig.spec.json polyfills.ts,Polyfills是进口核心JS / ES7 /反映,我也做同样在src / test.ts从src / test.ts中删除导入修复了我的问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM