简体   繁体   English

无法在Angular 5-ng测试中运行单元测试

[英]Unable to run unit test in Angular 5 - ng test

While running ng tes t, I am getting error 运行ng时,出现错误

" Uncaught TypeError: Zone.__load_patch is not a function ". 未捕获的TypeError:Zone .__ load_patch不是函数 ”。

I checked the source code in the debugger console in chrome, it is showing error ../zone.js/dist/async-test.js_global. 我在chrome调试器控制台中检查了源代码,它显示错误../zone.js/dist/async-test.js_global。 It was worked earlier but now seems some of the dependencies got upgraded. 它以前工作过,但现在似乎某些依赖项已升级。

Dev Dependencies version: 开发依赖项版本:

@Angular/cli: 1.2.7,
@angular/compiler-cli:~5.2.0,
@types/jasmine:2.5.38,
@types/jasminenewd:~2.0.2,
@types/node:~6.0.60,
karma:~1.4.1,
karma-chrome-launcher:~2.1.1,
Karma-cli: ~1.0.1, 
karma-jasmine: ~1.1.0, 
ts-node: ^3.3.0, 
talent: ~4.5.0

Dependencies: zone. 依赖项:区域。 js: ^0.8.4 js:^ 0.8.4

You're using quite a new zone.js with an Angular CLI that's very outdated. 您正在使用带有过时Angular CLI的全新zone.js。 That can't be right. 那是不对的。 Use the zone.js matching your angular version. 使用与您的角度版本匹配的zone.js。

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

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