major: import Fresh 2.0 code (#2449)

🎉
This commit is contained in:
Marvin Hagemeister
2024-05-24 09:40:08 +02:00
committed by GitHub
parent 990357629e
commit 287929e4d2
958 changed files with 15794 additions and 28287 deletions
+27
View File
@@ -0,0 +1,27 @@
import { expect } from "@std/expect";
import { MODE, setMode } from "./runtime/server/mod.tsx";
import { HttpError } from "./error.ts";
Deno.test("HttpError - contains stack in development", () => {
const tmp = MODE;
setMode("development");
try {
const err = new HttpError(404);
expect(err.status).toEqual(404);
expect(typeof err.stack).toEqual("string");
} finally {
setMode(tmp);
}
});
Deno.test("HttpError - contains no stack in production", () => {
const tmp = MODE;
setMode("production");
try {
const err = new HttpError(404);
expect(err.status).toEqual(404);
expect(err.stack).toEqual(undefined);
} finally {
setMode(tmp);
}
});