i have a function living in my utils that isn't part of a component at all
that function calls other functions, how can I mock this to test the conditional?
const myfunc = () =>
funcA().funcB() ? (
<Route path="somewhere" component={somecomponent} />
) : (
<Redirect to="/somewhere/else" />
);
how can I mock funcA and funcB to get them to return true and false to hit the correct part of the conditional? also how can I test for route path props?
i have this in my test at the moment but it is not generating the correct results
const funcA = jest.fn();
const funcB = jest.fn();
funcA.mockReturnValue(funcB);
funcB.mockReturnValue(true);