Expected to be running in 'ProxyZone' Angular Origin: On your device Last updated 15 Oct 2026

Angular tests: Error: Expected to be running in 'ProxyZone', but it was not found.

fakeAsync / waitForAsync was used, but the test environment's zone testing setup is missing.

Exact message you may see Expected to be running in 'ProxyZone', but it was not foundExpected to be running in 'ProxyZone'ProxyZone fakeAsyncError: Expected to be running in 'ProxyZone', but it was not found.
Seen on: Angular TypeScript

Meaning

fakeAsync needs zone.js/testing loaded. With Karma the CLI does it; with Jest you need jest-preset-angular and a setup-jest.ts importing it. Also happens when zone.js testing is imported twice, or tests run outside the Angular test runner.

Common causes

  • zone.js/testing not imported (Jest without setup-jest.ts)
  • jest-preset-angular missing or misconfigured
  • Using fakeAsync in a plain function outside it()
  • Mixed Zone.js versions
  • Test runner replaced without Angular's polyfills

⚡ Quick fix

  1. Create setup-jest.ts with import 'jest-preset-angular/setup-jest'; and reference it in the Jest config
  2. Use the preset: preset: 'jest-preset-angular'
  3. Call fakeAsync only inside it / beforeEach

Detailed fix by platform

npm

  1. npm i -D jest jest-preset-angular @types/jest
  2. jest.config.js: { preset: 'jest-preset-angular', setupFilesAfterEach: ['<rootDir>/setup-jest.ts'] } (older: setupFilesAfterEnv)

Code examples

Jest setup

javascript
// setup-jest.ts
import 'jest-preset-angular/setup-jest';

// jest.config.js
module.exports = { preset: 'jest-preset-angular', setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'] };

How to diagnose

  1. Runner — Karma or Jest?
  2. Setup — zone.js/testing loaded?
  3. Usage — fakeAsync inside an it block?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Cannot find control with name — Angular: Error: Cannot find control with name: 'email' (reactive forms) (Angular)Cannot find control w…Component is not resolved: templateUrl — Angular tests: Component 'X' is not resolved: templateUrl: ./x.component.html — Did you run and wait for 'resolveComponentResources()'? (Angular)Component is not reso…Could not find the builder's node package — Angular CLI: Could not find the '@angular-devkit/build-angular:browser' builder's node package / Cannot find module '@angular-devkit/build-angular/package.json' (Angular)Could not find the bu…exceeded maximum budget — Angular build: Error: bundle initial exceeded maximum budget. Budget 1.00 MB was not met by 120.00 kB with a total of 1.12 MB (Angular)exceeded maximum budg…Jest ESM — Jest: SyntaxError: Cannot use import statement outside a module (Jest encountered an unexpected token) (React)Jest ESMKarma Disconnected / no captured browser — Angular tests: Disconnected, because no message in 30000 ms. / ERROR [launcher]: Cannot start ChromeHeadless (Angular)Karma Disconnected / …Schema validation failed with the following errors — Angular CLI: Schema validation failed with the following errors: Data path "" must NOT have additional properties(xyz) (Angular)Schema validation fai…Expected …

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.