fix: ServerhandlerInfo type for newer Deno versions (#2419)
Newer Deno versions have an additional `completed` property in there. This PR allows Fresh to be used with both old and newer Deno versions without getting type errors.
This commit is contained in:
+2
-1
@@ -305,7 +305,8 @@ Deno.test("static files in custom directory", async () => {
|
||||
hostname: "127.0.0.1",
|
||||
port: 80,
|
||||
},
|
||||
});
|
||||
// deno-lint-ignore no-explicit-any
|
||||
} as any);
|
||||
};
|
||||
|
||||
const resp = await newRouter(
|
||||
|
||||
@@ -29,7 +29,8 @@ const router = (req: Request) => {
|
||||
hostname: "127.0.0.1",
|
||||
port: 80,
|
||||
},
|
||||
});
|
||||
// deno-lint-ignore no-explicit-any
|
||||
} as any);
|
||||
};
|
||||
|
||||
Deno.test("/static page prerender", async () => {
|
||||
@@ -98,7 +99,8 @@ Deno.test("plugin routes and middleware -- async _app", async () => {
|
||||
hostname: "127.0.0.1",
|
||||
port: 80,
|
||||
},
|
||||
});
|
||||
// deno-lint-ignore no-explicit-any
|
||||
} as any);
|
||||
};
|
||||
|
||||
const resp = await router(new Request("https://fresh.deno.dev/test"));
|
||||
|
||||
+2
-1
@@ -289,7 +289,8 @@ export async function fakeServe(
|
||||
const ctx = await ServerContext.fromManifest(manifest, config);
|
||||
const handler = ctx.handler();
|
||||
|
||||
const conn: ServeHandlerInfo = {
|
||||
// deno-lint-ignore no-explicit-any
|
||||
const conn: any = {
|
||||
remoteAddr: {
|
||||
transport: "tcp",
|
||||
hostname: "127.0.0.1",
|
||||
|
||||
@@ -15,7 +15,8 @@ const router = (req: Request) => {
|
||||
hostname: "127.0.0.1",
|
||||
port: 80,
|
||||
},
|
||||
});
|
||||
// deno-lint-ignore no-explicit-any
|
||||
} as any);
|
||||
};
|
||||
|
||||
Deno.test("forwards slash placed at the end of url", async () => {
|
||||
|
||||
Reference in New Issue
Block a user