Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: ProxyZone not found when using jest functions imported from @jest/globals #2193

Open
markoblagdan opened this issue Nov 28, 2023 · 1 comment

Comments

@markoblagdan
Copy link

markoblagdan commented Nov 28, 2023

Version

13.1.4

Steps to reproduce

  1. In a unit test file, import jest functions from @jest/globals package (example: import { describe, beforeEach, it } from '@jest/globals'; )
  2. Create a jest unit test and wrap an it or beforeEach callback with waitForAsync .
  3. Run unit test

Minimal repro available at https://stackblitz.com/edit/angular-16-jest-preset-cvsyqh?file=src%2Fapp%2Fapp.component.spec.ts

Expected behavior

Unit tests wrapped in waitForAsync (and fakeAsync? but haven't tested) should be able to run in ProxyZone.

Actual behavior

Wrapped unit test fails with message:

Expected to be running in 'ProxyZone', but it was not found.

Additional context

No response

Environment

System:
    OS: Linux 5.0 undefined (also occurs on Windows 10)
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
    pnpm: 8.10.5 - /usr/local/bin/pnpm
  npmPackages:
    jest: ^29.7.0 => 29.7.0 

Additional: Angular packages are versioned ^16.0.4
@dhardtke
Copy link

I believe this is an issue in upstream Zone.js, hence I created angular/angular#47603

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants