Enable clearMocks in Jest configuration

Description

Let's set clearMocks to true in our Jest configuration.

Why?

  • This way tests don't bump into eachother.
  • There's a lot of confusion between clear, restore, and reset when developers manually add the clear. In my experience, jest.clearAllMocks is what we inteded to do 99% of the time.

Context

The following discussion from !21856 (merged) should be addressed:

  • @winh started a discussion: (+1 comment)

    shall we consider https://jestjs.io/docs/en/configuration.html#clearmocks-boolean?

    shall we consider a follow-up issue?

Edited Dec 16, 2019 by Inactive Account
Assignee Loading
Time tracking Loading