feat(server): pick free port if none specified (#1274)

This commit is contained in:
Marvin Hagemeister
2023-06-12 13:18:52 +02:00
committed by GitHub
parent 69f4fecf5a
commit 36d56a9878
10 changed files with 107 additions and 61 deletions
+2 -2
View File
@@ -5,11 +5,11 @@ import { startFreshServer } from "../tests/test_utils.ts";
Deno.test("CORS should not set on GET /fresh-badge.svg", {
sanitizeResources: false,
}, async () => {
const { serverProcess, lines } = await startFreshServer({
const { serverProcess, lines, address } = await startFreshServer({
args: ["run", "-A", "./main.ts"],
});
const res = await fetch("http://localhost:8000/fresh-badge.svg");
const res = await fetch(`${address}/fresh-badge.svg`);
await res.body?.cancel();
assertEquals(res.headers.get("cross-origin-resource-policy"), null);