fix: invalid identifier in manifest (#2070)

This commit is contained in:
Marvin Hagemeister
2023-11-27 11:20:40 +01:00
committed by GitHub
parent 81e71adad6
commit 9d5e916e4c
9 changed files with 40 additions and 11 deletions
+2
View File
@@ -23,6 +23,7 @@ import * as $event_handler_string from "./routes/event_handler_string.tsx";
import * as $event_handler_string_island from "./routes/event_handler_string_island.tsx";
import * as $evil from "./routes/evil.tsx";
import * as $failure from "./routes/failure.ts";
import * as $foo_bar_baz from "./routes/foo.bar.baz.tsx";
import * as $head_deduplicate from "./routes/head_deduplicate.tsx";
import * as $hooks_server_island from "./routes/hooks-server/island.tsx";
import * as $hooks_server_useReducer from "./routes/hooks-server/useReducer.tsx";
@@ -121,6 +122,7 @@ const manifest = {
"./routes/event_handler_string_island.tsx": $event_handler_string_island,
"./routes/evil.tsx": $evil,
"./routes/failure.ts": $failure,
"./routes/foo.bar.baz.tsx": $foo_bar_baz,
"./routes/head_deduplicate.tsx": $head_deduplicate,
"./routes/hooks-server/island.tsx": $hooks_server_island,
"./routes/hooks-server/useReducer.tsx": $hooks_server_useReducer,
+3
View File
@@ -0,0 +1,3 @@
export default function Page() {
return <p>it works</p>;
}
+10
View File
@@ -77,3 +77,13 @@ Deno.test("support <Head /> with jsx precompile", async () => {
},
);
});
Deno.test("Ensure manifest has valid specifiers", async () => {
await withFakeServe(
"./tests/fixture/main.ts",
async (server) => {
const doc = await server.getHtml("/foo.bar.baz");
assertTextMany(doc, "p", ["it works"]);
},
);
});
-2
View File
@@ -12,7 +12,6 @@ Deno.test("index.tsx route handler test...", async (t) => {
const ctx = createHandlerContext(req, { manifest });
// @ts-ignore handler is not null
const resp = handler.GET(req, ctx) as Response;
console.log("resp", resp);
expect(resp.status).toBe(307);
expect(resp.headers.get("Location")?.endsWith("init.ts"));
});
@@ -31,7 +30,6 @@ Deno.test("index.tsx route handler test...", async (t) => {
};
// @ts-ignore handler is not null
const resp = handler.GET(req, ctx) as Response;
// console.log("resp", resp);
expect(resp.status).toBe(200);
});
});