Home / File/ mdx-plus-react-errors.test.js — astro Source File

mdx-plus-react-errors.test.js — astro Source File

Architecture documentation for mdx-plus-react-errors.test.js, a javascript file in the astro codebase. 4 imports, 0 dependents.

File javascript CoreAstro CoreMiddleware 4 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  32d39b99_193a_7269_07f0_c0294c0a03b2["mdx-plus-react-errors.test.js"]
  0a624eac_945e_c9e8_c9de_3feb9de2dd15["test-utils.js"]
  32d39b99_193a_7269_07f0_c0294c0a03b2 --> 0a624eac_945e_c9e8_c9de_3feb9de2dd15
  dd4f09ce_3fd7_8295_f616_8876cda4555c["loadFixture"]
  32d39b99_193a_7269_07f0_c0294c0a03b2 --> dd4f09ce_3fd7_8295_f616_8876cda4555c
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  32d39b99_193a_7269_07f0_c0294c0a03b2 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  32d39b99_193a_7269_07f0_c0294c0a03b2 --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  style 32d39b99_193a_7269_07f0_c0294c0a03b2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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

function hookError() {
	const error = console.error;
	const errors = [];
	console.error = function (...args) {
		errors.push(args);
	};
	return () => {
		console.error = error;
		return errors;
	};
}

describe('MDX and React with build errors', () => {
	let fixture;
	let unhook;

	it('shows correct error messages on build error', async () => {
		try {
			fixture = await loadFixture({
				root: new URL('./fixtures/mdx-plus-react-errors/', import.meta.url),
			});
			unhook = hookError();
			await fixture.build();
		} catch (err) {
			assert.equal(err.message, 'a is not defined');
		}
		unhook();
	});
});

Domain

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does mdx-plus-react-errors.test.js do?
mdx-plus-react-errors.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain, CoreMiddleware subdomain.
What functions are defined in mdx-plus-react-errors.test.js?
mdx-plus-react-errors.test.js defines 1 function(s): hookError.
What does mdx-plus-react-errors.test.js depend on?
mdx-plus-react-errors.test.js imports 4 module(s): loadFixture, node:test, strict, test-utils.js.
Where is mdx-plus-react-errors.test.js in the architecture?
mdx-plus-react-errors.test.js is located at packages/integrations/mdx/test/mdx-plus-react-errors.test.js (domain: CoreAstro, subdomain: CoreMiddleware, 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