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