how to mock in all files jest code example
Example: how to mock a library in jest
import randomColor from "randomcolor";
jest.mock("randomColor", () => {
return {
randomColor: () => {
return mockColor('#123456');
}
}
});
let mockColor = jest.fn();