Home / File/ custom-sitemaps.test.js — astro Source File

custom-sitemaps.test.js — astro Source File

Architecture documentation for custom-sitemaps.test.js, a javascript file in the astro codebase. 6 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  18b09de2_c704_9927_4702_9e5e2ae773e0["custom-sitemaps.test.js"]
  3e0bb597_9e66_530b_95f2_ac6ee9bd2ce9["deps.mjs"]
  18b09de2_c704_9927_4702_9e5e2ae773e0 --> 3e0bb597_9e66_530b_95f2_ac6ee9bd2ce9
  4b1e6526_afae_1cc3_9eb4_67fe4c476b26["test-utils.js"]
  18b09de2_c704_9927_4702_9e5e2ae773e0 --> 4b1e6526_afae_1cc3_9eb4_67fe4c476b26
  5ab044f2_ed09_99b6_2b30_c55f0f9a239c["loadFixture"]
  18b09de2_c704_9927_4702_9e5e2ae773e0 --> 5ab044f2_ed09_99b6_2b30_c55f0f9a239c
  b2ff3d1c_3baf_6707_d502_0f4b2a220a11["readXML"]
  18b09de2_c704_9927_4702_9e5e2ae773e0 --> b2ff3d1c_3baf_6707_d502_0f4b2a220a11
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  18b09de2_c704_9927_4702_9e5e2ae773e0 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  18b09de2_c704_9927_4702_9e5e2ae773e0 --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  style 18b09de2_c704_9927_4702_9e5e2ae773e0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import { sitemap } from './fixtures/static/deps.mjs';
import { loadFixture, readXML } from './test-utils.js';

describe('Custom sitemaps', () => {
	/** @type {import('./test-utils.js').Fixture} */
	let fixture;
	/** @type {{ [key: string]: string }} */
	let sitemaps;

	before(async () => {
		fixture = await loadFixture({
			root: './fixtures/static/',
			integrations: [
				sitemap({
					lastmod: new Date(),
					customSitemaps: ['http://example.com/custom-sitemap.xml'],
				}),
			],
		});
		await fixture.build();
		const data = await readXML(fixture.readFile('/sitemap-index.xml'));
		sitemaps = data.sitemapindex.sitemap.map((s) => ({ loc: s.loc[0], lastmod: s.lastmod[0] }));
	});

	it('includes defined custom sitemaps', async () => {
		assert.equal(
			sitemaps.some((s) => s.loc === 'http://example.com/custom-sitemap.xml'),
			true,
		);
	});

	it('includes lastmod for sitemaps', async () => {
		assert.equal(
			sitemaps.every((s) => typeof s.lastmod === 'string'),
			true,
		);
	});
});

Domain

Dependencies

Frequently Asked Questions

What does custom-sitemaps.test.js do?
custom-sitemaps.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does custom-sitemaps.test.js depend on?
custom-sitemaps.test.js imports 6 module(s): deps.mjs, loadFixture, node:test, readXML, strict, test-utils.js.
Where is custom-sitemaps.test.js in the architecture?
custom-sitemaps.test.js is located at packages/integrations/sitemap/test/custom-sitemaps.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