本文介绍了Angular 5测试:预期在"ProxyZone"中运行,但未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经使用Angular cli创建了一个新的Angular 5项目.运行默认测试时,出现以下错误:
I have created a new Angular 5 project using Angular cli. When I run the default test, I get the following error:
Error: Expected to be running in 'ProxyZone', but it was not found.
at Function.webpackJsonp.../../../../zone.js/dist/proxy.js.ProxyZoneSpec.assertPresent (http://localhost:9876/_karma_webpack_/webpack:/home/sukumar/workspace/bizAnalyst/partnerportal/node_modules/zone.js/dist/proxy.js:38:1)
如何纠正此问题?
P.S .: Angular版本:5.2.1
P.S.: Angular version: 5.2.1
推荐答案
当我不小心将fakeAsync
写到错误的行中时,我遇到了以下错误消息:
I encountered this error message when I accidentally wrote fakeAsync
into the wrong line:
错误:
describe('My Test', fakeAsync(() => {
it('should work', () => {
右:
describe('My Test', () => {
it('should work', fakeAsync(() => {
这篇关于Angular 5测试:预期在"ProxyZone"中运行,但未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!