Stability round two: no language links on POST-rendered pages, scoped observers, Vary only where it varies
CI / full-gate (push) Successful in 2m37s

This commit is contained in:
2026-08-04 00:10:31 +02:00
parent be3bc2bdbb
commit 93139ea058
11 changed files with 66 additions and 21 deletions
+3 -2
View File
@@ -44,11 +44,12 @@ test("runRequestHooks short-circuits on the first RouteResult (with its plugin);
test("runResponseHooks runs every onResponse as an observer with the result; a throw fails", async () => {
const seen: unknown[] = [];
const contextFor = () => ctx; // each observer gets a context scoped to its own plugin
await runResponseHooks([
plugin("a", { onResponse: (_c, r) => void seen.push(r) }),
plugin("b", {}), // no onResponse → skipped
], ctx, { html: "ok" });
], contextFor, { html: "ok" });
assert.deepEqual(seen, [{ html: "ok" }]);
await assert.rejects(runResponseHooks([plugin("x", { onResponse: () => { throw new Error("boom"); } })], ctx, null), /boom/);
await assert.rejects(runResponseHooks([plugin("x", { onResponse: () => { throw new Error("boom"); } })], contextFor, null), /boom/);
});