React項目Jest常見問題彙總

- document和window的方法可用jest.fn()模擬(例:`window.open is not a function`)ios window.open = jest.fn(); document.execCommand = jest.fn(); - 列表頁等具備多個查詢條件的url,可用String.prototype.includes()來mock路徑(例:`pages?per_
相關文章
相關標籤/搜索