fix: code frame not showing up in dev mode (#1814)
This commit is contained in:
@@ -25,6 +25,20 @@ Deno.test({
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "dev_command config: shows codeframe",
|
||||
async fn() {
|
||||
await withFakeServe(
|
||||
"./tests/fixture_dev_config/dev.ts",
|
||||
async (server) => {
|
||||
const doc = await server.getHtml("/codeframe");
|
||||
assertSelector(doc, ".frsh-error-page");
|
||||
assertSelector(doc, ".code-frame");
|
||||
},
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "dev_command legacy",
|
||||
async fn() {
|
||||
@@ -38,6 +52,20 @@ Deno.test({
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "dev_command legacy: shows codeframe",
|
||||
async fn() {
|
||||
await withFakeServe(
|
||||
"./tests/fixture_dev_legacy/dev.ts",
|
||||
async (server) => {
|
||||
const doc = await server.getHtml("/codeframe");
|
||||
assertSelector(doc, ".frsh-error-page");
|
||||
assertSelector(doc, ".code-frame");
|
||||
},
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test("adds refresh script to html", async () => {
|
||||
await withFakeServe("./tests/fixture/dev.ts", async (server) => {
|
||||
const doc = await server.getHtml("/");
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
// This file SHOULD be checked into source version control.
|
||||
// This file is automatically updated during development when running `dev.ts`.
|
||||
|
||||
import * as $0 from "./routes/index.tsx";
|
||||
import * as $0 from "./routes/codeframe.tsx";
|
||||
import * as $1 from "./routes/index.tsx";
|
||||
|
||||
const manifest = {
|
||||
routes: {
|
||||
"./routes/index.tsx": $0,
|
||||
"./routes/codeframe.tsx": $0,
|
||||
"./routes/index.tsx": $1,
|
||||
},
|
||||
islands: {},
|
||||
baseUrl: import.meta.url,
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// deno-lint-ignore no-explicit-any
|
||||
export default function Page(): any {
|
||||
throw new Error("fail");
|
||||
}
|
||||
@@ -2,11 +2,13 @@
|
||||
// This file SHOULD be checked into source version control.
|
||||
// This file is automatically updated during development when running `dev.ts`.
|
||||
|
||||
import * as $0 from "./routes/index.tsx";
|
||||
import * as $0 from "./routes/codeframe.tsx";
|
||||
import * as $1 from "./routes/index.tsx";
|
||||
|
||||
const manifest = {
|
||||
routes: {
|
||||
"./routes/index.tsx": $0,
|
||||
"./routes/codeframe.tsx": $0,
|
||||
"./routes/index.tsx": $1,
|
||||
},
|
||||
islands: {},
|
||||
baseUrl: import.meta.url,
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// deno-lint-ignore no-explicit-any
|
||||
export default function Page(): any {
|
||||
throw new Error("fail");
|
||||
}
|
||||
Reference in New Issue
Block a user