update assertion
This commit is contained in:
parent
c2826f0aeb
commit
36855598be
|
|
@ -201,6 +201,8 @@ export class Request extends ChannelOwner<channels.RequestChannel> implements ap
|
|||
}
|
||||
|
||||
frame(): Frame {
|
||||
if (this._pageForMockingProxy)
|
||||
throw new Error('Frame for this request is not available, because the request was issued on the server.');
|
||||
if (!this._initializer.frame) {
|
||||
assert(this.serviceWorker());
|
||||
throw new Error('Service Worker requests do not have an associated frame.');
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ test('all properties are populated', async ({ runInlineTest, server, request })
|
|||
|
||||
expect(await response.finished()).toBe(null);
|
||||
expect(request.serviceWorker()).toBe(null);
|
||||
expect(() => request.frame()).toThrowError("Assertion error"); // we know the page, but not the frame. should probably improve the error message
|
||||
expect(() => request.frame()).toThrowError("Frame for this request is not available, because the request was issued on the server.");
|
||||
|
||||
expect(request.failure()).toBe(null);
|
||||
expect(request.isNavigationRequest()).toBe(false);
|
||||
|
|
|
|||
Loading…
Reference in a new issue