mockRequest(url, params, request, settings) {
    return new Promise(async (resolve) => {
      let response = null;
      let ok = true;

      try {
        const fakeRequest = new Request(request);

        if (typeof request.body === "string") {
          fakeRequest.body = JSON.parse(request.body);
        }

        response = await settings.mock(url, params ?? {}, fakeRequest);
      } catch (err) {
        console.error(err);
        ok = false;
      }

      setTimeout(() => {
        resolve({
          ok,
          json() {
            return Promise.resolve(response);
          },
          text() {
            return typeof response === "string" ? response : JSON.stringify(response);
          },
          headers: {},
          status: 200,
        });
      }, this.mockDelay);
    });
  }
Emulate server call
@param {string} url
@param {Request} params
@param {EndpointConfig} settings