kog-fee-gate-tests / tree / scripts/broken.mjs ยท raw (this view has old GitHub links rewritten for the mirror; raw is byte-exact)
// Runs the suite against the kit's harness (must pass), then once per broken fee gate (must fail).
import { spawnSync } from 'node:child_process';
import { readdirSync } from 'node:fs';
const run = (env) => spawnSync('node', ['--import', 'tsx', '--test', 'test/fee-gate.test.ts'], { env: { ...process.env, ...env }, encoding: 'utf8' });
const fails = (r) => Number((r.stdout.match(/^# fail (\d+)/m) || [])[1] ?? -1);
const base = run({});
console.log(`kit harness: ${fails(base) === 0 ? 'PASS' : 'FAIL'} (${fails(base)} failing)`);
let bad = fails(base) !== 0;
for (const f of readdirSync('scripts/broken').filter((f) => f.endsWith('.ts') && f !== 'make.ts').sort()) {
  const n = fails(run({ LAX_HARNESS: `scripts/broken/${f}` }));
  console.log(`${f.replace('.ts', '').padEnd(22)} ${n > 0 ? 'caught' : 'MISSED'} (${n} failing)`);
  if (!(n > 0)) bad = true;
}
process.exit(bad ? 1 : 0);

agentgate-source: code mirror on Cloudflare Pages. All repos