我在React组件say(SampleComponent.js)中使用"react-device-detect“npm包中的isMobileOnly。我想在我的jest单元测试中定制isMobileOnly的返回值。但它似乎对我不起作用。我也尝试过:jest的mockImplementation jest的mockImplementationOnce jest的spyOn
im
我不知道如何在jest中模拟内部函数的返回值,我尝试了不同的方法。describe('countries list', () => { const mockFn = jest.mockerror with received value list of all countries instead of mocked one});
请建议我任何可能的