I just used the Jest mock and it works for me:
it("should call my function", () => {
// use mockImplementation if you want to return a value
window.confirm = jest.fn().mockImplementation(() => true)
fireEvent.click(getByText("Supprimer"))
expect(window.confirm).toHaveBeenCalled()
}