abort
次のいずれかのエラーコードでリクエストを中止します: Failed
, Aborted
, TimedOut
, AccessDenied
, ConnectionClosed
, ConnectionReset
, ConnectionRefused
, ConnectionAborted
, ConnectionFailed
, NameNotResolved
, InternetDisconnected
, AddressUnreachable
, BlockedByClient
, BlockedByResponse
。
使用方法
mock.abort(errorCode)
パラメーター
名前 | 型 | 詳細 |
---|---|---|
errorCode | ErrorCode | レスポンスのエラーコード。次のいずれか: Failed , Aborted , TimedOut , AccessDenied , ConnectionClosed , ConnectionReset , ConnectionRefused , ConnectionAborted , ConnectionFailed , NameNotResolved , InternetDisconnected , AddressUnreachable , BlockedByClient , BlockedByResponse |
例
abort.js
it('should block Google Analytics from page', async () => {
const mock = await browser.mock('https://#/**')
mock.abort('Failed')
})