跳至主要內容

clear

重設儲存在 mock.calls 陣列中的所有資訊。

用法
mock.clear()
範例
clear.js
it('should clear mock', async () => {
const mock = await browser.mock('https://google.com/')
await browser.url('https://google.com')

console.log(mock.calls.length) // returns 1
mock.clear()
console.log(mock.calls.length) // returns 0
})

歡迎!我可以如何幫您?

WebdriverIO AI Copilot