angular - 角度cli 6,ng测试不起作用
问题描述
我刚刚将我的 Angular 项目更新为 Angular 6。
ng build 和 ng serve 工作,但是当我使用以下命令运行测试时:
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"
]
}
}
我究竟做错了什么 ?
解决方案
我解决了。不知何故,当我将项目升级到 Angular 6 时,tsConfig
密钥在 test -> options 中丢失了angular.json
。
推荐阅读
- reactjs - Reactjs - 使用下拉菜单搜索
- java - 突然我的应用程序无法进行 HTTPS 查询
- python - AttributeError:“命令”对象没有属性“检查”
- javascript - JQuery计算中的简单条件
- javascript - 如何在 JavaScript 的对话框提示中隐藏用户输入的密码?
- android - 我无法更改 inputType,为我的 EditText 提示任何内容
- java - 在java中使用setter方法设置文本后,阿拉伯语文本被反转
- reactjs - Reactjs-当一个下拉菜单改变时重置下拉菜单
- python - 使用依赖项安装私有 python 包
- php - Laravel Eloquent 关系与来自两个模型的属性分组