{"record":{"id":"810f904a6da7a126","repo":"angular/angular","slug":"only-globals-are-patched-with-zone-testing-if-you","errorCode":null,"errorMessage":"Only globals are patched with zone-testing. If you import `it`, `describe`, etc. directly, you cannot use `fakeAsync` or `waitForAsync`.","messagePattern":"Only globals are patched with zone-testing\\. If you import `it`, `describe`, etc\\. directly, you cannot use `fakeAsync` or `waitForAsync`\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/zone.js/lib/zone-spec/proxy.ts","lineNumber":16,"sourceCode":"/**\n * @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","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/angular/angular/blob/51cb07e98081ab7e4e84a9e0949266a8e19cca84/packages/zone.js/lib/zone-spec/proxy.ts#L1-L34","documentation":"Error \"Only globals are patched with zone-testing. If you import `it`, `describe`, etc. directly, you cannot use `fakeAsync` or `waitForAsync`.\" thrown in angular/angular.","triggerScenarios":"Thrown at packages/zone.js/lib/zone-spec/proxy.ts:16 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the global it/describe functions patched by zone-testing instead of importing them directly from the test framework."],"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"}