Skip to content

Commit 437e6d2

Browse files
author
Lennart Klose
committed
Update .eslintrc.json to support node fetch types
1 parent f99986f commit 437e6d2

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

.eslintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"plugin:jest/recommended"
55
],
66
"globals": {
7-
"Console": true
7+
"Console": true,
8+
"RequestInfo": true,
9+
"RequestInit": true
810
},
911
"env": {
1012
"node": true,

packages/core/src/dvelop-fetch/dvelop-fetch.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,8 @@ describe("dvelopFetch", () => {
209209

210210
await dvelopFetch(context, "/api/endpoint", customInit);
211211

212-
expect(deepMergeObjects).toHaveBeenCalledWith(
213-
expect.objectContaining({
214-
headers: expect.any(Object),
215-
}),
216-
customInit
217-
);
212+
expect(deepMergeObjects).toHaveBeenCalledWith(expect.objectContaining({
213+
headers: expect.any(Object),
214+
}), customInit);
218215
});
219216
});

packages/core/src/dvelop-fetch/dvelop-fetch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export async function dvelopFetch(context: DvelopContext, input: RequestInfo | U
2121
defaultInit.headers["traceparent"] = buildTraceparentHeader(context.traceContext);
2222
}
2323

24-
const fetchInput: RequestInfo | URL = (context.systemBaseUri || "") + input
25-
const fetchInit: RequestInit = deepMergeObjects(defaultInit, init || {})
24+
const fetchInput: RequestInfo | URL = (context.systemBaseUri || "") + input;
25+
const fetchInit: RequestInit = deepMergeObjects(defaultInit, init || {});
2626

27-
return fetch(fetchInput, fetchInit)
27+
return fetch(fetchInput, fetchInit);
2828
}

0 commit comments

Comments
 (0)