import { describe, it, expect } from "vitest"; import { execSync } from "node:child_process"; import path from "node:path"; import { fileURLToPath } from "node:url"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const GUARD = path.join(__dirname, "state-sync-guard.mjs"); describe("state-sync-guard smoke", () => { it("exits 0 when run against the repo's current state (since main is in sync)", () => { // Run the guard; if main's _state.json drifts, execSync throws (non-zero // exit) and this test fails with the guard's output. expect(() => execSync(`node "${GUARD}"`, { encoding: "utf8" }), ).not.toThrow(); }); });