summaryrefslogtreecommitdiff
path: root/packages/integrations/mdx/test/mdx-plus-react-errors.test.js
blob: 9d87fa8a0045ff517a70af54ccc22b4851e28f8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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();
	});
});
-08 14:08:13 -0600'>2022-12-08Update compiler (#5554)Gravatar Nate Moore 3-5/+10 * chore: update compiler * chore: add changeset Co-authored-by: Nate Moore <nate@astro.build> 2022-12-08docs: How to access base config in the app (#5482)Gravatar Alvin Bryan 1-0/+2 2022-12-08Improve README install guide (#5479)Gravatar Nyx Iskandar 1-2/+5 * Improve README install guide * Fix punctuations 2022-12-08[ci] release (#5544)astro@1.6.14@astrojs/rss@1.1.0@astrojs/netlify@1.2.2@astrojs/deno@2.0.1@astrojs/cloudflare@4.1.1Gravatar Fred K. Bot 48-121/+121 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2022-12-08[ci] formatGravatar matthewp 2-2/+4 2022-12-08fix: Error reporting fails on undefined error index (#5539)Gravatar wulinsheng123 2-1/+6 * fix: Error reporting fails on undefined error index * fix: add changeset * Update .changeset/slow-cherries-bake.md Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> 2022-12-08astro-rss: Generate feed with proper XML escaping (#5550)Gravatar Anders Kaseorg 5-36/+57 * test(astro-rss): Compare XML using chai-xml Signed-off-by: Anders Kaseorg <andersk@mit.edu> * fix(astro-rss): Generate feed with proper XML escaping Signed-off-by: Anders Kaseorg <andersk@mit.edu> Signed-off-by: Anders Kaseorg <andersk@mit.edu> 2022-12-08Fix Astro.params not having values when using base in SSR (#5553)Gravatar Matthew Phillips 6-4/+66 * Fix Astro.params not having values when using base in SSR * Adding a changeseet 2022-12-07Allow all redirection status codes in redirect() (#5446)Gravatar Jeffrey Yasskin 2-1/+6 See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages for the list. 2022-12-06feat(astro-rss): generate post content in feed (#5366)Gravatar Ben Smith 4-1/+46 2022-12-06[ci] formatGravatar matthewp 2-7/+6 2022-12-06Use accumulated sort order when order production CSS (#5549)Gravatar Matthew Phillips 15-2/+180 * Use accumulated sort order when order production CSS * Adding a changeset * Fix lockfile issue 2022-12-06[ci] formatGravatar matthewp 22-158/+171 2022-12-06Head propagation (#5511)Gravatar Matthew Phillips 36-279/+804 * Head propagation * Adding a changeset * Fix broken build * Self review stuff * Use compiler prerelease exact version * new compiler version * Update packages/astro/src/vite-plugin-head-propagation/index.ts Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> * Use getAstroMetadata * add .js * make relative lookup work on win * Use compiler@0.30.0 * PR review comments * Make renderHead an alias for a better named function Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> 2022-12-06[ci] formatGravatar matthewp 1-7/+7 2022-12-06Removed premature optimization (#5548)Gravatar Ido S 2-37/+35 2022-12-06Exclude astro from Vite optimization (#5545)Gravatar Bjorn Lu 2-1/+6 2022-12-06bench workflow - use bash as shell (#5546)Gravatar Matthew Phillips 1-2/+4 2022-12-06bench workflow - pipe stderr (#5543)Gravatar Matthew Phillips 1-2/+4 2022-12-06Update esbuild dependency (#5534)Gravatar Bjorn Lu 7-18/+275 2022-12-06Fix tests with node 18 (#5528)Gravatar Bjorn Lu 1-9/+14