Home / File/ invalid-mdx-component.test.js — astro Source File

invalid-mdx-component.test.js — astro Source File

Architecture documentation for invalid-mdx-component.test.js, a javascript file in the astro codebase. 5 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  bbbf406e_61d3_496a_7785_264030fb4db7["invalid-mdx-component.test.js"]
  0a624eac_945e_c9e8_c9de_3feb9de2dd15["test-utils.js"]
  bbbf406e_61d3_496a_7785_264030fb4db7 --> 0a624eac_945e_c9e8_c9de_3feb9de2dd15
  dd4f09ce_3fd7_8295_f616_8876cda4555c["loadFixture"]
  bbbf406e_61d3_496a_7785_264030fb4db7 --> dd4f09ce_3fd7_8295_f616_8876cda4555c
  10338527_d0d2_45c2_fb1d_63fd1d8694a4["../dist/index.js"]
  bbbf406e_61d3_496a_7785_264030fb4db7 --> 10338527_d0d2_45c2_fb1d_63fd1d8694a4
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  bbbf406e_61d3_496a_7785_264030fb4db7 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  bbbf406e_61d3_496a_7785_264030fb4db7 --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  style bbbf406e_61d3_496a_7785_264030fb4db7 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 { loadFixture } from '../../../astro/test/test-utils.js';
import mdx from '../dist/index.js';

const FIXTURE_ROOT = new URL('./fixtures/invalid-mdx-component/', import.meta.url);

describe('MDX component with runtime error', () => {
	let fixture;

	before(async () => {
		fixture = await loadFixture({
			root: FIXTURE_ROOT,
			integrations: [mdx()],
		});
	});

	describe('build', () => {
		/** @type {Error | null} */
		let error;

		before(async () => {
			error = null;
			try {
				await fixture.build();
			} catch (e) {
				error = e;
			}
		});

		it('Throws the right error', async () => {
			assert.ok(error);
			assert.match(
				error?.hint,
				/This issue often occurs when your MDX component encounters runtime errors/,
			);
		});
	});
});

Domain

Dependencies

Frequently Asked Questions

What does invalid-mdx-component.test.js do?
invalid-mdx-component.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does invalid-mdx-component.test.js depend on?
invalid-mdx-component.test.js imports 5 module(s): ../dist/index.js, loadFixture, node:test, strict, test-utils.js.
Where is invalid-mdx-component.test.js in the architecture?
invalid-mdx-component.test.js is located at packages/integrations/mdx/test/invalid-mdx-component.test.js (domain: CoreAstro, 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