Home / Function/ clearEnvironment() — astro Function Reference

clearEnvironment() — astro Function Reference

Architecture documentation for the clearEnvironment() function in test-utils.js from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  315dfc4b_d8ce_edad_539f_f42fcad25ec4["clearEnvironment()"]
  9c9ba75b_c6f1_7d10_d247_9a1ccac73501["test-utils.js"]
  315dfc4b_d8ce_edad_539f_f42fcad25ec4 -->|defined in| 9c9ba75b_c6f1_7d10_d247_9a1ccac73501
  style 315dfc4b_d8ce_edad_539f_f42fcad25ec4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/db/test/test-utils.js lines 89–96

export function clearEnvironment() {
	const keys = Array.from(Object.keys(process.env));
	for (const key of keys) {
		if (key.startsWith('ASTRO_DB_')) {
			delete process.env[key];
		}
	}
}

Domain

Subdomains

Frequently Asked Questions

What does clearEnvironment() do?
clearEnvironment() is a function in the astro codebase, defined in packages/db/test/test-utils.js.
Where is clearEnvironment() defined?
clearEnvironment() is defined in packages/db/test/test-utils.js at line 89.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free