Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.6K
Views
Jest issue. FakeTimers: clearTimeout was invoked to clear a native timer instead of one created by this library

After the update of Node.js from version 14 to version 16, we've got a lot of failed tests on bitbucket CI/CD pipelines. Locally tests pass.

Seems like the problem in timers, cause the first error message says: "FakeTimers: clearTimeout was invoked to clear a native timer instead of one created by this library. To automatically clean-up native timers, use shouldClearNativeTimers". After that, a bunch of test fails.

After adding "--runInBand" parameter for jest it solves the issue, but it's not an ideal approach.

Will appreciate any help.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

i had this same issue.

Adding

jest.runOnlyPendingTimers()
jest.useRealTimers()

in the end of my test that had the useFakeTimers() fixed it.

reference: https://testing-library.com/docs/using-fake-timers/

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!