* Sets up environment variables and returns a cleanup function.
(variables: Record<string, string>)
| 387 | * Sets up environment variables and returns a cleanup function. |
| 388 | */ |
| 389 | function setupEnvVars(variables: Record<string, string>) { |
| 390 | const originalEnv = { ...process.env } |
| 391 | Object.assign(process.env, variables) |
| 392 | |
| 393 | return () => { |
| 394 | Object.keys(variables).forEach((key) => delete process.env[key]) |
| 395 | Object.entries(originalEnv).forEach(([key, value]) => { |
| 396 | if (value !== undefined) process.env[key] = value |
| 397 | }) |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | describe('Tools Registry', () => { |
| 402 | it('should include all expected built-in tools', () => { |