Home / Function/ loadFixture() — astro Function Reference

loadFixture() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  5b5870e5_6570_8950_c56d_3170427d28c7["loadFixture()"]
  6edce826_f6ba_1758_b163_54ce397ea33f["test-utils.js"]
  5b5870e5_6570_8950_c56d_3170427d28c7 -->|defined in| 6edce826_f6ba_1758_b163_54ce397ea33f
  acd4a219_f994_eae3_65f9_a97d2d3c7f3c["testFactory()"]
  acd4a219_f994_eae3_65f9_a97d2d3c7f3c -->|calls| 5b5870e5_6570_8950_c56d_3170427d28c7
  dd4f09ce_3fd7_8295_f616_8876cda4555c["loadFixture()"]
  5b5870e5_6570_8950_c56d_3170427d28c7 -->|calls| dd4f09ce_3fd7_8295_f616_8876cda4555c
  style 5b5870e5_6570_8950_c56d_3170427d28c7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/alpinejs/test/test-utils.js lines 17–29

function loadFixture(inlineConfig) {
	if (!inlineConfig?.root) throw new Error("Must provide { root: './fixtures/...' }");

	// resolve the relative root (i.e. "./fixtures/tailwindcss") to a full filepath
	// without this, the main `loadFixture` helper will resolve relative to `packages/astro/test`
	return baseLoadFixture({
		...inlineConfig,
		root: fileURLToPath(new URL(inlineConfig.root, import.meta.url)),
		server: {
			port: testFileToPort.get(path.basename(inlineConfig.root)),
		},
	});
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does loadFixture() do?
loadFixture() is a function in the astro codebase, defined in packages/integrations/alpinejs/test/test-utils.js.
Where is loadFixture() defined?
loadFixture() is defined in packages/integrations/alpinejs/test/test-utils.js at line 17.
What does loadFixture() call?
loadFixture() calls 1 function(s): loadFixture.
What calls loadFixture()?
loadFixture() is called by 1 function(s): testFactory.

Analyze Your Own Codebase

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

Try Supermodel Free