trailing-slash.test.js — astro Source File
Architecture documentation for trailing-slash.test.js, a javascript file in the astro codebase. 5 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 2c33a093_fe30_ab72_639d_a0321d27fc2b["trailing-slash.test.js"] 4b1e6526_afae_1cc3_9eb4_67fe4c476b26["test-utils.js"] 2c33a093_fe30_ab72_639d_a0321d27fc2b --> 4b1e6526_afae_1cc3_9eb4_67fe4c476b26 5ab044f2_ed09_99b6_2b30_c55f0f9a239c["loadFixture"] 2c33a093_fe30_ab72_639d_a0321d27fc2b --> 5ab044f2_ed09_99b6_2b30_c55f0f9a239c b2ff3d1c_3baf_6707_d502_0f4b2a220a11["readXML"] 2c33a093_fe30_ab72_639d_a0321d27fc2b --> b2ff3d1c_3baf_6707_d502_0f4b2a220a11 e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"] 2c33a093_fe30_ab72_639d_a0321d27fc2b --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] 2c33a093_fe30_ab72_639d_a0321d27fc2b --> 6b0635f9_51ea_77aa_767b_7857878e98a6 style 2c33a093_fe30_ab72_639d_a0321d27fc2b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import { loadFixture, readXML } from './test-utils.js';
describe('Trailing slash', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
describe('trailingSlash: ignore', () => {
describe('build.format: directory', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/trailing-slash/',
trailingSlash: 'ignore',
build: {
format: 'directory',
},
});
await fixture.build();
});
it('URLs end with trailing slash', async () => {
const data = await readXML(fixture.readFile('/sitemap-0.xml'));
const urls = data.urlset.url;
assert.equal(urls[0].loc[0], 'http://example.com/');
assert.equal(urls[1].loc[0], 'http://example.com/one/');
assert.equal(urls[2].loc[0], 'http://example.com/two/');
});
});
describe('build.format: file', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/trailing-slash/',
trailingSlash: 'ignore',
build: {
format: 'file',
},
});
await fixture.build();
});
it('URLs do not end with trailing slash', async () => {
const data = await readXML(fixture.readFile('/sitemap-0.xml'));
const urls = data.urlset.url;
assert.equal(urls[0].loc[0], 'http://example.com');
assert.equal(urls[1].loc[0], 'http://example.com/one');
assert.equal(urls[2].loc[0], 'http://example.com/two');
});
});
});
describe('trailingSlash: never', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/trailing-slash/',
trailingSlash: 'never',
});
// ... (68 more lines)
Domain
Dependencies
- loadFixture
- node:test
- readXML
- strict
- test-utils.js
Source
Frequently Asked Questions
What does trailing-slash.test.js do?
trailing-slash.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does trailing-slash.test.js depend on?
trailing-slash.test.js imports 5 module(s): loadFixture, node:test, readXML, strict, test-utils.js.
Where is trailing-slash.test.js in the architecture?
trailing-slash.test.js is located at packages/integrations/sitemap/test/trailing-slash.test.js (domain: CoreAstro, directory: packages/integrations/sitemap/test).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free