我试图在我的angular / 6项目上运行ng test
,但是它永远找不到正确的环境文件。无论如何,它始终加载environment/environment.ts
。我已经更新了angular.json,使其在配置部分中包含以下几行
"test": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements":
[
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.test.ts"
}
]
},
但无济于事。我尝试使用命令运行
ng test --configuration=test
和
ng test --environment=test
没有运气。有人可以建议吗?