loadFixture() — astro Function Reference
Architecture documentation for the loadFixture() function in _test-utils.js from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 33b9a01d_12ac_568f_9775_9e80b35139cb["loadFixture()"] 635e1221_67bb_e784_624a_d6d63643872b["_test-utils.js"] 33b9a01d_12ac_568f_9775_9e80b35139cb -->|defined in| 635e1221_67bb_e784_624a_d6d63643872b dd4f09ce_3fd7_8295_f616_8876cda4555c["loadFixture()"] 33b9a01d_12ac_568f_9775_9e80b35139cb -->|calls| dd4f09ce_3fd7_8295_f616_8876cda4555c style 33b9a01d_12ac_568f_9775_9e80b35139cb fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/integrations/cloudflare/test/_test-utils.js lines 6–38
export async 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`
const fixture = await baseLoadFixture({
...inlineConfig,
root: new URL(inlineConfig.root, import.meta.url).toString(),
});
// For unknown reasons, the error below could raise during testing. We add a retry mechanism to handle it.
// Some further investigation is needed to understand the root cause.
//
// Unable to build fixture for the attempt 1: Error: There is a new version of the pre-bundle for "/astro/packages/integrations/cloudflare/test/fixtures/with-svelte/node_modules/.vite/deps_ssr/svelte_server.js?v=9924cddf", a page reload is going to ask for it.
const buildWithRetry = async function (...args) {
let err;
for (let attempt = 1; attempt <= 3; attempt++) {
try {
const result = await fixture.build(...args);
return result;
} catch (error) {
console.error(`Unable to build fixture for the attempt ${attempt}:`, error);
err = error;
}
}
if (err) {
throw err;
}
};
return { ...fixture, build: buildWithRetry };
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does loadFixture() do?
loadFixture() is a function in the astro codebase, defined in packages/integrations/cloudflare/test/_test-utils.js.
Where is loadFixture() defined?
loadFixture() is defined in packages/integrations/cloudflare/test/_test-utils.js at line 6.
What does loadFixture() call?
loadFixture() calls 1 function(s): loadFixture.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free