mirror of
https://github.com/block/buzz.git
synced 2026-10-31 22:41:12 +00:00
Signed-off-by: Brother Darryl <146fb160a3266e6165bfa385f6048c975eda9e21cf65da097a0b5ea7952532a5@buzz.block.builderlab.xyz>
25 lines
780 B
JavaScript
25 lines
780 B
JavaScript
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);
|
|
}
|