jest-preset-angular: [Bug]: Jest open handles after upgrade from angular v12 to v13

Version

11.1.2

Steps to reproduce

  1. Clone https://github.com/SimonMueller/jest-preset-angular-open-handle-reproduction
  2. Run npm i
  3. Run npm t
  4. See test output

Expected behavior

No open handles after tests are done executing.

Actual behavior

Two open handles after tests are done executing. See screenshot: image

Additional context

We saw this behavior after upgrading from angular 12 where these open handles are not present. I tested this aswell with the repo above.

Environment

System:
    OS: Linux 5.15 Ubuntu 22.04 LTS 22.04 (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
  Binaries:
    Node: 14.19.1 - ~/.nvm/versions/node/v14.19.1/bin/node
    npm: 6.14.16 - ~/.nvm/versions/node/v14.19.1/bin/npm
  npmPackages:
    jest: 27.5.1 => 27.5.1

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 14
  • Comments: 19

Most upvoted comments

It seems that the problem is related to this library, not to Angular.

https://github.com/angular/angular/issues/45776#issuecomment-1143113716

Hello, same error with angular v14 image

image

seem like this is the issue. It comes from getTestBed