mirror of
https://github.com/vale981/apollo-server
synced 2025-03-04 17:21:42 -05:00
Fix apollo-server-env
mock
This commit is contained in:
parent
cef701e6c1
commit
787846c64b
2 changed files with 7 additions and 7 deletions
|
@ -46,16 +46,16 @@ mockFetch.mockJSONResponseOnce = (
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export {
|
const env = {
|
||||||
mockFetch as fetch,
|
fetch: mockFetch,
|
||||||
Request,
|
Request,
|
||||||
RequestInit,
|
|
||||||
Response,
|
Response,
|
||||||
Body,
|
Body,
|
||||||
BodyInit,
|
|
||||||
Headers,
|
Headers,
|
||||||
HeadersInit,
|
|
||||||
URL,
|
URL,
|
||||||
URLSearchParams,
|
URLSearchParams,
|
||||||
URLSearchParamsInit,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
jest.doMock('apollo-server-env', () => env);
|
||||||
|
|
||||||
|
export = env;
|
||||||
|
|
|
@ -160,7 +160,7 @@ function policyResponseFrom(response: Response) {
|
||||||
|
|
||||||
function headersToObject(headers: Headers) {
|
function headersToObject(headers: Headers) {
|
||||||
const object = Object.create(null);
|
const object = Object.create(null);
|
||||||
for (const [name, value] of headers as Headers) {
|
for (const [name, value] of headers) {
|
||||||
object[name] = value;
|
object[name] = value;
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
|
|
Loading…
Add table
Reference in a new issue