我正在尝试编写一个测试用例,用于在我的react原生应用程序中测试URL。这是我的模拟
import { Linking } from "react-native";
jest.mock('react-native/Libraries/Linking/Linking', () => {
return {
openURL: jest.fn()
}
})
Linking.openURL.mockImplementation(() => true)
这是我的测试
test('open google url',async ()=>{
expect(Linking.openURL()).toHaveBeenCalled('https://www.google.com/')
})
但是我得到了这个错误,我该怎么办?
软件测试工具