astro-get-static-paths.test.js — astro Source File
Architecture documentation for astro-get-static-paths.test.js, a javascript file in the astro codebase. 5 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 96aac543_b8cb_46ab_6862_2327c22c3dce["astro-get-static-paths.test.js"] 0a624eac_945e_c9e8_c9de_3feb9de2dd15["test-utils.js"] 96aac543_b8cb_46ab_6862_2327c22c3dce --> 0a624eac_945e_c9e8_c9de_3feb9de2dd15 dd4f09ce_3fd7_8295_f616_8876cda4555c["loadFixture"] 96aac543_b8cb_46ab_6862_2327c22c3dce --> dd4f09ce_3fd7_8295_f616_8876cda4555c e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"] 96aac543_b8cb_46ab_6862_2327c22c3dce --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] 96aac543_b8cb_46ab_6862_2327c22c3dce --> 6b0635f9_51ea_77aa_767b_7857878e98a6 deb87372_5629_35f8_9a54_e755a08f776a["cheerio"] 96aac543_b8cb_46ab_6862_2327c22c3dce --> deb87372_5629_35f8_9a54_e755a08f776a style 96aac543_b8cb_46ab_6862_2327c22c3dce fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
// @ts-check
import assert from 'node:assert/strict';
import { after, afterEach, before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
const root = new URL('./fixtures/astro-get-static-paths/', import.meta.url);
const paramsTypePlugin = (type = 'string') => ({
name: 'vite-plugin-param-type',
resolveId: {
filter: {
id: /^virtual:my:param:type$/,
},
handler() {
return '\0virtual:my:param:type';
},
},
load: {
filter: {
id: /^\0virtual:my:param:type$/,
},
handler() {
return `export const paramType = ${JSON.stringify(type)}`;
},
},
});
function resetFlags() {
// reset the flag used by [...calledTwiceTest].astro between each test
globalThis.isCalledOnce = false;
// reset the flag used by [...invalidParamsTypeTest].astro between each test
globalThis.getStaticPathsParamsType = undefined;
}
describe('getStaticPaths - build calls', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
before(async () => {
fixture = await loadFixture({
root,
site: 'https://mysite.dev/',
trailingSlash: 'never',
base: '/blog',
vite: {
plugins: [paramsTypePlugin()],
},
});
await fixture.build({});
});
afterEach(() => {
resetFlags();
});
it('is only called once during build', () => {
// useless expect; if build() throws in setup then this test fails
assert.equal(true, true);
// ... (259 more lines)
Domain
Subdomains
Functions
Dependencies
- cheerio
- loadFixture
- node:test
- strict
- test-utils.js
Source
Frequently Asked Questions
What does astro-get-static-paths.test.js do?
astro-get-static-paths.test.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 astro-get-static-paths.test.js?
astro-get-static-paths.test.js defines 2 function(s): paramsTypePlugin, resetFlags.
What does astro-get-static-paths.test.js depend on?
astro-get-static-paths.test.js imports 5 module(s): cheerio, loadFixture, node:test, strict, test-utils.js.
Where is astro-get-static-paths.test.js in the architecture?
astro-get-static-paths.test.js is located at packages/astro/test/astro-get-static-paths.test.js (domain: IntegrationAdapters, subdomain: SsrAdapters, directory: packages/astro/test).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free