I use isMobileOnly
from "react-device-detect" npm package in my React component say(SampleComponent.js).
I would like to customize the return value of isMobileOnly
in my jest unit tests.
I have tried Jest manual mocks as mentioned in the link below: https://jestjs.io/docs/en/manual-mocks
But it does not seem to work for me.
I have also tried: jest's mockImplementation jest's mockImplementationOnce jest's spyOn
import {isMobileOnly} from 'react-device-detect;
In my jest unit tests, i would like to mock the function isMobileOnly
in such a way that i should be able to customize its return value to "true". The default value is "false".