fix: change MultiHandler back to Handlers (#1396)

This commit is contained in:
Marvin Hagemeister
2023-07-03 09:57:46 +02:00
committed by GitHub
parent eb53d53ab8
commit 16be99e69b
32 changed files with 135 additions and 66 deletions
+17
View File
@@ -10,6 +10,7 @@ import manifest from "./fixture/fresh.gen.ts";
import options from "./fixture/options.ts";
import { BUILD_ID } from "../src/server/build_id.ts";
import { startFreshServer } from "./test_utils.ts";
import { assertMatch } from "https://deno.land/std@0.190.0/testing/asserts.ts";
const ctx = await ServerContext.fromManifest(manifest, options);
const handler = ctx.handler();
@@ -815,6 +816,22 @@ Deno.test("PORT environment variable", {
serverProcess.kill("SIGTERM");
});
Deno.test("throw on route export 'handlers' instead of 'handler'", {
sanitizeOps: false,
sanitizeResources: false,
}, async () => {
const result = await new Deno.Command(Deno.execPath(), {
args: ["run", "-A", "./tests/fixture_invalid_handlers/main.ts"],
stderr: "piped",
stdout: "piped",
}).output();
assertEquals(result.code, 1);
const text = new TextDecoder().decode(result.stderr);
assertMatch(text, /Did you mean "handler"\?/);
});
Deno.test("rendering custom _500.tsx page for default handlers", {
sanitizeOps: false,
sanitizeResources: false,