feat: add plugin configResolved (#2055)

This commit is contained in:
Marvin Hagemeister
2023-11-21 15:39:17 +01:00
committed by GitHub
parent 0a85a1fe5f
commit daf15aee6f
15 changed files with 134 additions and 1 deletions
+15
View File
@@ -151,6 +151,9 @@ Deno.test("calls buildStart() and buildEnd()", async () => {
);
assertEquals(out, [
"Plugin a: configResolved",
"Plugin b: configResolved",
"Plugin c: configResolved",
"Plugin a: buildStart",
"Plugin b: buildStart",
`Plugin c: ${join("tests", "fixture_plugin_lifecycle", "_fresh")}`,
@@ -159,6 +162,18 @@ Deno.test("calls buildStart() and buildEnd()", async () => {
]);
});
Deno.test("calls configResolved() in dev", async () => {
await withFakeServe(
"./tests/fixture_plugin_resolved_dev/dev.ts",
async (server) => {
const res = await server.get("/");
await res.text();
assertEquals(res.headers.get("X-Plugin-A"), "true");
},
{ loadConfig: true },
);
});
Deno.test("plugin script doesn't halt island execution", async () => {
await withPageName(
"./tests/fixture_plugin_error/main.ts",