Skip to content
Permalink
Browse files

Fix `apollo-server-env` mock

  • Loading branch information...
martijnwalraven committed Oct 11, 2018
1 parent cef701e commit 787846c64b703699cbe4918c698a20371e7ca0a9
Showing with 7 additions and 7 deletions.
  1. +6 −6 __mocks__/apollo-server-env.ts
  2. +1 −1 packages/apollo-datasource-rest/src/HTTPCache.ts
@@ -46,16 +46,16 @@ mockFetch.mockJSONResponseOnce = (
);
};

export {
mockFetch as fetch,
const env = {
fetch: mockFetch,
Request,
RequestInit,
Response,
Body,
BodyInit,
Headers,
HeadersInit,
URL,
URLSearchParams,
URLSearchParamsInit,
};

jest.doMock('apollo-server-env', () => env);

export = env;
@@ -160,7 +160,7 @@ function policyResponseFrom(response: Response) {

function headersToObject(headers: Headers) {
const object = Object.create(null);
for (const [name, value] of headers as Headers) {
for (const [name, value] of headers) {
object[name] = value;
}
return object;

0 comments on commit 787846c

Please sign in to comment.
You can’t perform that action at this time.