Home / Function/ teardown() — astro Function Reference

teardown() — astro Function Reference

Architecture documentation for the teardown() function in teardown.js from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  e77dfada_26a0_3a8f_1fa9_098a25b24701["teardown()"]
  1ee4fa59_99fb_8c2c_9bee_97f2cd2804bb["teardown.js"]
  e77dfada_26a0_3a8f_1fa9_098a25b24701 -->|defined in| 1ee4fa59_99fb_8c2c_9bee_97f2cd2804bb
  style e77dfada_26a0_3a8f_1fa9_098a25b24701 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/test/units/teardown.js lines 3–19

export default function teardown(testPassed) {
	// Delete all directories within `_temp-fixtures` directory if all test passed
	if (testPassed) {
		try {
			const tempFixturesDir = new URL('./_temp-fixtures/', import.meta.url);
			const entries = fs.readdirSync(tempFixturesDir);
			for (const entry of entries) {
				if (entry === 'package.json' || entry === 'node_modules') continue;
				const dir = new URL(entry, tempFixturesDir);
				fs.rmSync(dir, { recursive: true });
			}
		} catch (e) {
			console.error('Failed to delete temp fixtures');
			throw e;
		}
	}
}

Subdomains

Frequently Asked Questions

What does teardown() do?
teardown() is a function in the astro codebase, defined in packages/astro/test/units/teardown.js.
Where is teardown() defined?
teardown() is defined in packages/astro/test/units/teardown.js at line 3.

Analyze Your Own Codebase

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

Try Supermodel Free