updated tests regarding problematic Request() init fields (ref. #23)

merge-requests/8/merge
Michał 'rysiek' Woźniak 2021-11-17 13:57:47 +00:00
rodzic 646e7240a5
commit 2603596032
2 zmienionych plików z 9 dodań i 6 usunięć

Wyświetl plik

@ -217,9 +217,10 @@ describe("service-worker", () => {
var initTest = {
method: "GET",
headers: new Headers({"x-stub": "STUB"}),
mode: "mode-stub",
credentials: "credentials-stub",
// TODO: ref. https://gitlab.com/rysiekpl/libresilient/-/issues/23
//headers: new Headers({"x-stub": "STUB"}),
//mode: "mode-stub",
//credentials: "credentials-stub",
cache: "cache-stub",
referrer: "referrer-stub",
// these are not implemented by service-worker-mock
@ -727,9 +728,10 @@ describe("service-worker", () => {
var initTest = {
method: "GET",
headers: new Headers({"x-stub": "STUB"}),
mode: "mode-stub",
credentials: "credentials-stub",
// TODO: ref. https://gitlab.com/rysiekpl/libresilient/-/issues/23
//headers: new Headers({"x-stub": "STUB"}),
//mode: "mode-stub",
//credentials: "credentials-stub",
cache: "cache-stub",
referrer: "referrer-stub",
// these are not implemented by service-worker-mock

Wyświetl plik

@ -418,6 +418,7 @@ let LibResilientResourceInfo = class {
let initFromRequest = (req) => {
return {
method: req.method,
// TODO: ref. https://gitlab.com/rysiekpl/libresilient/-/issues/23
//headers: req.headers, TODO: commented out: https://stackoverflow.com/questions/32500073/request-header-field-access-control-allow-headers-is-not-allowed-by-itself-in-pr
//mode: req.mode, TODO: commented out because mode: navigate is haram in service worker, it seems
//credentials: req.credentials, TODO: commented out because credentials: "include" is haram if the Access-Control-Allow-Origin header is '*'