You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of adding the respondWith() custom method on the Fetch API Request representation of the intercepted request, expose that method alongside the request in the listener argument object.
interfaceRequestController{// Instruct the interceptor to perform the request as-is.passthrough(): void// Use the given response as the mock response for the request.respondWith(response: Response): void// Use the given error as the request error.errorWith(error?: Error): void// Abort the request.// In some clients (ClientRequest) it's synonymous to ".errorWith()",// in others (XMLHttpRequest) it's different. abort(): void}
The request controller is exposed in the request listener argument:
The request controller can only handle the request once. Once any of its methods are called, calling methods on it again must throw an error (the same way calling request.respondWith() multiple times right now throws an error).
Instead of adding the
respondWith()
custom method on the Fetch APIRequest
representation of the intercepted request, expose that method alongside the request in the listener argument object.This also resembles the Service Worker's
fetch
event a bit more closely. Not that it has ever the intention but it's a nice little detail.The text was updated successfully, but these errors were encountered: