Skip to content

Commit

Permalink
Fix tests using React.cache()
Browse files Browse the repository at this point in the history
  • Loading branch information
oBusk committed Nov 20, 2022
1 parent 0ab09b7 commit bd76786
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
import "@testing-library/jest-dom/extend-expect";

// Override the react.cache method to avoid caching in tests
jest.mock("react", () => {
const React = jest.requireActual("react");
React.cache = (fn) => fn;
return React;
});

0 comments on commit bd76786

Please sign in to comment.