test(test-isolation): add diagnostic regression test for cross-suite leak

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-05-20 13:33:05 +09:00
parent 504a7779e7
commit c6dc266f2f
@@ -0,0 +1,25 @@
import { beforeEach, describe, expect, it } from "bun:test";
import { existsSync, readdirSync } from "node:fs";
import { RULES_INJECTOR_STORAGE } from "./constants";
function readStorageEntries(): readonly string[] {
if (!existsSync(RULES_INJECTOR_STORAGE)) return [];
return readdirSync(RULES_INJECTOR_STORAGE);
}
describe("rules injector test isolation", () => {
beforeEach(() => {
const leakedEntries = readStorageEntries();
expect(leakedEntries).toEqual([]);
});
it("#given the shared test setup runs #then persisted injected-rule state starts empty", () => {
// given: test-setup beforeEach has already run
// when
const entries = readStorageEntries();
// then
expect(entries).toEqual([]);
});
});