Skip to content

Commit 2d3fe06

Browse files
committed
fix(api): avoid DOM RequestInit in Skiller CORS test
1 parent dcdd8c1 commit 2d3fe06

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/api/tests/skiller-cors.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ const apiHandler = HttpApp.toWebHandler(
1212
Effect.provide(Effect.flatten(HttpRouter.toHttpApp(makeRouter())), NodeContext.layer)
1313
)
1414

15-
const requestApiRoute = (path: string, init: RequestInit) =>
15+
type ApiRequestInit = {
16+
readonly headers: Record<string, string>
17+
readonly method: string
18+
}
19+
20+
const requestApiRoute = (path: string, init: ApiRequestInit) =>
1621
Effect.tryPromise({
1722
try: () => apiHandler(new Request(`http://127.0.0.1${path}`, init)),
1823
catch: (cause) => new Error(String(cause))

0 commit comments

Comments
 (0)