Home / File/ mdx-get-static-paths.test.js — astro Source File

mdx-get-static-paths.test.js — astro Source File

Architecture documentation for mdx-get-static-paths.test.js, a javascript file in the astro codebase. 6 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  1c4f7f47_f495_0a59_7492_dc1c54b7e7d2["mdx-get-static-paths.test.js"]
  00a2554b_127e_f517_31a9_3bcd1edd111d["test-utils.js"]
  1c4f7f47_f495_0a59_7492_dc1c54b7e7d2 --> 00a2554b_127e_f517_31a9_3bcd1edd111d
  a2e8916f_09d6_61ff_ee5e_719f62dea5c4["loadFixture"]
  1c4f7f47_f495_0a59_7492_dc1c54b7e7d2 --> a2e8916f_09d6_61ff_ee5e_719f62dea5c4
  0e588d0c_5409_f008_bf3b_3762dd6c1c5a["strict"]
  1c4f7f47_f495_0a59_7492_dc1c54b7e7d2 --> 0e588d0c_5409_f008_bf3b_3762dd6c1c5a
  fa887d9d_247c_d770_d661_490745669024["node:test"]
  1c4f7f47_f495_0a59_7492_dc1c54b7e7d2 --> fa887d9d_247c_d770_d661_490745669024
  6a08aefe_fe41_8b61_16c0_9fd42b7fe981["mdx"]
  1c4f7f47_f495_0a59_7492_dc1c54b7e7d2 --> 6a08aefe_fe41_8b61_16c0_9fd42b7fe981
  bdfc66a8_5f37_125b_833d_b5149405ee7a["cheerio"]
  1c4f7f47_f495_0a59_7492_dc1c54b7e7d2 --> bdfc66a8_5f37_125b_833d_b5149405ee7a
  style 1c4f7f47_f495_0a59_7492_dc1c54b7e7d2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import mdx from '@astrojs/mdx';
import * as cheerio from 'cheerio';
import { loadFixture } from '../../../astro/test/test-utils.js';

const FIXTURE_ROOT = new URL('./fixtures/mdx-get-static-paths', import.meta.url);

describe('getStaticPaths', () => {
	/** @type {import('astro/test/test-utils').Fixture} */
	let fixture;
	before(async () => {
		fixture = await loadFixture({
			root: FIXTURE_ROOT,
			integrations: [mdx()],
		});
		await fixture.build();
	});

	it('Provides file and url', async () => {
		const html = await fixture.readFile('/one/index.html');

		const $ = cheerio.load(html);
		assert.equal($('p').text(), 'First mdx file');
		assert.equal($('#one').text(), 'hello', 'Frontmatter included');
		assert.equal($('#url').text(), 'src/content/1.mdx', 'url is included');
		assert.equal(
			$('#file').text().includes('fixtures/mdx-get-static-paths/src/content/1.mdx'),
			true,
			'file is included',
		);
	});
});

Dependencies

Frequently Asked Questions

What does mdx-get-static-paths.test.js do?
mdx-get-static-paths.test.js is a source file in the astro codebase, written in javascript. It belongs to the TestingInfrastructure domain.
What does mdx-get-static-paths.test.js depend on?
mdx-get-static-paths.test.js imports 6 module(s): cheerio, loadFixture, mdx, node:test, strict, test-utils.js.
Where is mdx-get-static-paths.test.js in the architecture?
mdx-get-static-paths.test.js is located at packages/integrations/mdx/test/mdx-get-static-paths.test.js (domain: TestingInfrastructure, directory: packages/integrations/mdx/test).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free