angular/angular · error · Error
ProxyZoneSpec is needed for the fakeAsync and waitForAsync t
Error message
ProxyZoneSpec is needed for the fakeAsync and waitForAsync test helpers but could not be found. Make sure that your environment includes zone-testing.js
What it means
Error "ProxyZoneSpec is needed for the fakeAsync and waitForAsync test helpers but could not be found. Make sure that your environment includes zone-testing.js" thrown in angular/angular.
Source
Thrown at packages/zone.js/lib/zone-spec/proxy.ts:20
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {ZoneType} from '../zone-impl';
declare let jest: any;
export function throwProxyZoneError(): never {
const jestPatched = typeof jest !== 'undefined' && jest['__zone_patch__'];
if (jestPatched) {
throw new Error(
'Only globals are patched with zone-testing. If you import `it`, `describe`, etc. directly, you cannot use `fakeAsync` or `waitForAsync`.',
);
} else {
throw new Error(
'ProxyZoneSpec is needed for the fakeAsync and waitForAsync test helpers but could not be found. ' +
'Make sure that your environment includes zone-testing.js',
);
}
}
export class ProxyZoneSpec implements ZoneSpec {
name: string = 'ProxyZone';
private _delegateSpec: ZoneSpec | null = null;
properties: {[k: string]: any} = {'ProxyZoneSpec': this};
propertyKeys: string[] | null = null;
lastTaskState: HasTaskState | null = null;
isNeedToTriggerHasTask = false;
private tasks: Task[] = [];View on GitHub (pinned to 51cb07e980)
Solutions
- Add zone-testing.js to the test setup files.
When it happens
Trigger: Thrown at packages/zone.js/lib/zone-spec/proxy.ts:20 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of angular/angular@51cb07e980 (2026-08-22).
Data as JSON: /api/errors/0d905f658a3bfd2d.
Report an issue: GitHub.