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)
How to rectify this issue?
P.S.: Angular version: 5.2.1
I encountered this error message when I accidentally wrote fakeAsync
into the wrong line:
WRONG:
describe('My Test', fakeAsync(() => {
it('should work', () => {
RIGHT:
describe('My Test', () => {
it('should work', fakeAsync(() => {
Might possibly in some cases be caused by reduce_vars on uglifyjs... in our case with Angular 6 and Webpack 4 (and uglifyjs-webpack-plugin 2.0.1).
Unsure what other contributing factors there might be, just something a colleague found out when trying to narrow a similiar problem down when upgrading to webpack4.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With