MCPcopy Index your code
hub / github.com/simstudioai/sim / setupEnvVars

Function setupEnvVars

apps/sim/tools/index.test.ts:389–399  ·  view source on GitHub ↗

* Sets up environment variables and returns a cleanup function.

(variables: Record<string, string>)

Source from the content-addressed store, hash-verified

387 * Sets up environment variables and returns a cleanup function.
388 */
389function 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
401describe('Tools Registry', () => {
402 it('should include all expected built-in tools', () => {

Callers 1

index.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected