static-build.test.js — astro Source File
Architecture documentation for static-build.test.js, a javascript file in the astro codebase. 6 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 8471ccab_7433_7e69_af6a_2a12f4246c8b["static-build.test.js"] f5b154b4_7bf2_7c8f_2105_5c84d2420bd1["../../dist/core/logger/core.js"] 8471ccab_7433_7e69_af6a_2a12f4246c8b --> f5b154b4_7bf2_7c8f_2105_5c84d2420bd1 0a624eac_945e_c9e8_c9de_3feb9de2dd15["test-utils.js"] 8471ccab_7433_7e69_af6a_2a12f4246c8b --> 0a624eac_945e_c9e8_c9de_3feb9de2dd15 dd4f09ce_3fd7_8295_f616_8876cda4555c["loadFixture"] 8471ccab_7433_7e69_af6a_2a12f4246c8b --> dd4f09ce_3fd7_8295_f616_8876cda4555c e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"] 8471ccab_7433_7e69_af6a_2a12f4246c8b --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] 8471ccab_7433_7e69_af6a_2a12f4246c8b --> 6b0635f9_51ea_77aa_767b_7857878e98a6 deb87372_5629_35f8_9a54_e755a08f776a["cheerio"] 8471ccab_7433_7e69_af6a_2a12f4246c8b --> deb87372_5629_35f8_9a54_e755a08f776a style 8471ccab_7433_7e69_af6a_2a12f4246c8b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import { load as cheerioLoad } from 'cheerio';
import { Logger } from '../dist/core/logger/core.js';
import { loadFixture } from './test-utils.js';
function addLeadingSlash(path) {
return path.startsWith('/') ? path : '/' + path;
}
function removeBasePath(path) {
// `/subpath` is defined in the test fixture's Astro config
return path.replace('/subpath', '');
}
/**
* @typedef {import('../src/core/logger/core').LogMessage} LogMessage
*/
describe('Static build', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
/** @type {LogMessage[]} */
let logs = [];
before(async () => {
/** @type {import('../src/core/logger/core').Logger} */
const logger = new Logger({
dest: {
write(chunk) {
logs.push(chunk);
},
},
level: 'warn',
});
fixture = await loadFixture({
root: './fixtures/static-build/',
// test suite was authored when inlineStylesheets defaulted to never
build: { inlineStylesheets: 'never' },
});
await fixture.build({ logger });
});
it('generates canonical redirect page with site prefix', async () => {
const html = await fixture.readFile('/old/index.html');
const $ = cheerioLoad(html);
const link = $('link[rel="canonical"]');
const href = link.attr('href');
assert.match(href, /http/);
});
it('Builds out .astro pages', async () => {
const html = await fixture.readFile('/index.html');
assert.equal(typeof html, 'string');
});
it('can build pages using import.meta.glob()', async () => {
const html = await fixture.readFile('/index.html');
const $ = cheerioLoad(html);
// ... (161 more lines)
Domain
Subdomains
Functions
Dependencies
- ../../dist/core/logger/core.js
- cheerio
- loadFixture
- node:test
- strict
- test-utils.js
Source
Frequently Asked Questions
What does static-build.test.js do?
static-build.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 static-build.test.js?
static-build.test.js defines 2 function(s): addLeadingSlash, removeBasePath.
What does static-build.test.js depend on?
static-build.test.js imports 6 module(s): ../../dist/core/logger/core.js, cheerio, loadFixture, node:test, strict, test-utils.js.
Where is static-build.test.js in the architecture?
static-build.test.js is located at packages/astro/test/static-build.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