mirror of
https://github.com/Heretek-AI/IUMBTEMS.git
synced 2026-11-07 10:56:00 -10:00
#314 scrubbed BRAVE_API_KEY per test file, which leaves the next research test free to reintroduce the leak. A bun test preload now deletes every setting the research providers and the gateway backend read, for every run started from the repo root. Tests that need one still set their own value. - scripts/test-preload.ts: the scrub. - bunfig.toml: [test] preload. - core/test/clean-room.test.ts: a probe suite started with all six settings exported must see none of them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
14 lines
481 B
TypeScript
14 lines
481 B
TypeScript
// Preloaded by every root `bun test` run (bunfig.toml, [test] preload). Web
|
|
// provider settings exported in the developer's shell must never reach a
|
|
// suite: a real key sends fixture queries to the live API and spends quota
|
|
// (#312). A test that needs one sets its own value after this runs.
|
|
for (const key of [
|
|
"BRAVE_API_KEY",
|
|
"FIRECRAWL_API_KEY",
|
|
"FIRECRAWL_API_URL",
|
|
"SEARXNG_URL",
|
|
"ES_SCRAPER_SWARM_URL",
|
|
"ES_SCRAPER_SWARM_TOKEN",
|
|
])
|
|
delete process.env[key]
|