From 82be6215af173aad4cb0bda98dbc2854cbdd9496 Mon Sep 17 00:00:00 2001 From: Denis Omelkov Date: Wed, 20 Nov 2019 16:28:31 +0500 Subject: [PATCH] refactor(service-worker): set http method in MockRequest constructor (#33930) Enable to create mocks for mutating http requests in tests to check more scenarios. PR Close #33930 --- packages/service-worker/worker/testing/fetch.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/service-worker/worker/testing/fetch.ts b/packages/service-worker/worker/testing/fetch.ts index 41605a3b20..5661d1a7f2 100644 --- a/packages/service-worker/worker/testing/fetch.ts +++ b/packages/service-worker/worker/testing/fetch.ts @@ -110,6 +110,9 @@ export class MockRequest extends MockBody implements Request { if (init.credentials !== undefined) { this.credentials = init.credentials; } + if (init.method !== undefined) { + this.method = init.method; + } } clone(): Request {