mirror of
https://github.com/vale981/apollo-server
synced 2025-03-04 09:11:40 -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 {
|
||||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue