{"record":{"id":"0d905f658a3bfd2d","repo":"angular/angular","slug":"proxyzonespec-is-needed-for-the-fakeasync-and-wait","errorCode":null,"errorMessage":"ProxyZoneSpec is needed for the fakeAsync and waitForAsync test helpers but could not be found. Make sure that your environment includes zone-testing.js","messagePattern":"ProxyZoneSpec is needed for the fakeAsync and waitForAsync test helpers but could not be found\\. Make sure that your environment includes zone-testing\\.js","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/zone.js/lib/zone-spec/proxy.ts","lineNumber":20,"sourceCode":" * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ZoneType} from '../zone-impl';\n\ndeclare let jest: any;\n\nexport function throwProxyZoneError(): never {\n  const jestPatched = typeof jest !== 'undefined' && jest['__zone_patch__'];\n  if (jestPatched) {\n    throw new Error(\n      'Only globals are patched with zone-testing. If you import `it`, `describe`, etc. directly, you cannot use `fakeAsync` or `waitForAsync`.',\n    );\n  } else {\n    throw new Error(\n      'ProxyZoneSpec is needed for the fakeAsync and waitForAsync test helpers but could not be found. ' +\n        'Make sure that your environment includes zone-testing.js',\n    );\n  }\n}\n\nexport class ProxyZoneSpec implements ZoneSpec {\n  name: string = 'ProxyZone';\n\n  private _delegateSpec: ZoneSpec | null = null;\n\n  properties: {[k: string]: any} = {'ProxyZoneSpec': this};\n  propertyKeys: string[] | null = null;\n\n  lastTaskState: HasTaskState | null = null;\n  isNeedToTriggerHasTask = false;\n\n  private tasks: Task[] = [];","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/angular/angular/blob/51cb07e98081ab7e4e84a9e0949266a8e19cca84/packages/zone.js/lib/zone-spec/proxy.ts#L2-L38","documentation":"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.","triggerScenarios":"Thrown at packages/zone.js/lib/zone-spec/proxy.ts:20 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add zone-testing.js to the test setup files."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"51cb07e98081ab7e4e84a9e0949266a8e19cca84","analyzedAt":"2026-08-22T07:04:54.531Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}