Home / File/ teardown.js — astro Source File

teardown.js — astro Source File

Architecture documentation for teardown.js, a javascript file in the astro codebase. 1 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  1ee4fa59_99fb_8c2c_9bee_97f2cd2804bb["teardown.js"]
  e16a223b_37f3_6b25_1ee1_2b7bcb9d9415["node:fs"]
  1ee4fa59_99fb_8c2c_9bee_97f2cd2804bb --> e16a223b_37f3_6b25_1ee1_2b7bcb9d9415
  style 1ee4fa59_99fb_8c2c_9bee_97f2cd2804bb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import fs from 'node:fs';

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

Functions

Dependencies

  • node:fs

Frequently Asked Questions

What does teardown.js do?
teardown.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain, SsrAdapters subdomain.
What functions are defined in teardown.js?
teardown.js defines 1 function(s): teardown.
What does teardown.js depend on?
teardown.js imports 1 module(s): node:fs.
Where is teardown.js in the architecture?
teardown.js is located at packages/astro/test/units/teardown.js (domain: IntegrationAdapters, subdomain: SsrAdapters, directory: packages/astro/test/units).

Analyze Your Own Codebase

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

Try Supermodel Free