0

I recently upgraded to jest v28 from v24, installed jest-environment-jsdom and my configuration is "jest": { "testEnvironment": "jsdom", "setupFiles": [ "<rootDir>/setup.js" ] } I was using done it('test', (done) => { done() }) in many places in the same test file, i am getting the error "Expected done to be called once, but it was called multiple times." when i enable multiple test cases, it works fine with single test case.

Niyaz
  • 2,677
  • 3
  • 21
  • 40

1 Answers1

0

When you use your spy/mock multiple times in different tests, they don't get reset by default after every test.

This answer should help you: https://stackoverflow.com/a/55873465/16068019

leonbubova
  • 109
  • 1
  • 4