test(e2e): require explicit origin bootstrap

Signed-off-by: Brother Darryl <146fb160a3266e6165bfa385f6048c975eda9e21cf65da097a0b5ea7952532a5@buzz.block.builderlab.xyz>
This commit is contained in:
Brother Darryl
2026-08-18 10:56:16 -04:00
parent c3f5e6bb5d
commit 7ea8fde379
160 changed files with 1237 additions and 1187 deletions

View File

@@ -0,0 +1,24 @@
import fs from "node:fs";
import path from "node:path";
const projectRoot = path.resolve(import.meta.dirname, "..");
const specs = fs
.readdirSync(path.join(projectRoot, "tests/e2e"))
.filter((name) => /\.(spec|perf)\.ts$/.test(name));
const exempt = new Set(["agents-everywhere.live.spec.ts"]);
const violations = [];
for (const name of specs) {
if (exempt.has(name)) continue;
const source = fs.readFileSync(
path.join(projectRoot, "tests/e2e", name),
"utf8",
);
if (!source.includes('from "../helpers/test"')) continue;
if (!/await\s+bootstrapE2ePage\(/.test(source)) violations.push(name);
}
if (violations.length) {
console.error(
`E2E specs must register bootstrapE2ePage after their setup:\n${violations.join("\n")}`,
);
process.exit(1);
}