Coder Social home page Coder Social logo

Comments (4)

musojames avatar musojames commented on August 16, 2024

I've run into the same issue with node 19.0.1 on Mac OS Monterrey 12.6

from fake-timers.

mrazauskas avatar mrazauskas commented on August 16, 2024

How to reproduce
Have the latest node and jest versions installed

Above you mention that "@jest/fake-timers": "^28.1.3" is installed. The latest Jest version v29.5.0.

Which one did you actually use? The latest one or v28? Did you try upgrading to the latest one?


If upgrading does not help, since Jest v28 you can excluding performance from the list of faked APIs: jest.useFakeTimers({doNotFake: ['performance']});

Reference: jestjs/jest#12055 (comment)

from fake-timers.

fatso83 avatar fatso83 commented on August 16, 2024

@charlieyeng Reproducible with Jest 28. Not reproducible with Jest 29 and Node 19. This means you need to upgrade your Jest version.

$ cat test/foo.test.js

test('hey', () => {
   jest.useFakeTimers()
})

$ npx jest test/foo.test.js
 PASS  test/foo.test.js
  ✓ hey

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.155 s
Ran all test suites matching /test\/foo.test.js/i.

from fake-timers.

SimenB avatar SimenB commented on August 16, 2024

Duplicate of #438, fwiw

from fake-timers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.