MCPcopy Create free account
hub / github.com/EvoMap/evolver / withCleanGeneDirectiveEnv

Function withCleanGeneDirectiveEnv

test/evolveHub.test.js:101–114  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

99}
100
101async function withCleanGeneDirectiveEnv(fn) {
102 const origForced = process.env.EVOLVER_FORCED_GENE_ID;
103 const origRequired = process.env.EVOLVER_REQUIRED_GENE_ID;
104 delete process.env.EVOLVER_FORCED_GENE_ID;
105 delete process.env.EVOLVER_REQUIRED_GENE_ID;
106 try {
107 return await fn();
108 } finally {
109 if (origForced !== undefined) process.env.EVOLVER_FORCED_GENE_ID = origForced;
110 else delete process.env.EVOLVER_FORCED_GENE_ID;
111 if (origRequired !== undefined) process.env.EVOLVER_REQUIRED_GENE_ID = origRequired;
112 else delete process.env.EVOLVER_REQUIRED_GENE_ID;
113 }
114}
115
116describe('hubCoordinate', () => {
117 it('returns ctx with activeTask null and hubLessons empty when no tasks available', async () => {

Callers 1

evolveHub.test.jsFile · 0.85

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected