SyntaxFix
Write A Post
Hire A Developer
Questions
I'm directly assigning jest.fn() to window.open.
jest.fn()
window.open
window.open = jest.fn() // ...code expect(window.open).toHaveBeenCalledTimes(1) expect(window.open).toHaveBeenCalledWith('/new-tab','__blank')