Jest: .LegacyFakeTimers is not a constructor

Created on 11 May 2020  ยท  5Comments  ยท  Source: facebook/jest

Hello,

this is the case as of the latest version.

Apologies for not adding more context, but I guess it should do it.

    TypeError: _fakeTimers(...).LegacyFakeTimers is not a constructor

      at new JSDOMEnvironment (node_modules/jest-environment-jsdom/build/index.js:127:23)
Bug Report Needs Repro Needs Triage

Most helpful comment

you can use "jest": "24.3.1" to have a try!

All 5 comments

This needs more info yes. I'm guessing a mismatch of versions, or an old custom test environment not yet upgraded to jest 26.

Closing for now, but happy to reopen if you can provide a minimal reproduction

I just found this bug while running JEST in Docker container:

TypeError: _fakeTimers(...).JestFakeTimers is not a constructor

โ— Test suite failed to run

TypeError: _fakeTimers(...).JestFakeTimers is not a constructor

  at new JSDOMEnvironment (node_modules/jest-environment-jsdom/build/index.js:149:23)

I just found this bug while running JEST in Docker container:

TypeError: _fakeTimers(...).JestFakeTimers is not a constructor

have you solve it?

you can use "jest": "24.3.1" to have a try!

Was this page helpful?
0 / 5 - 0 ratings