astro/packages/integrations/mdx/test/mdx-plus-react.test.js
Matthew Phillips 8eb3a8c6d9
Add test for mdx + React usage (#4174)
* Add test for mdx + React usage

* Add a changeset

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-05 17:13:30 -04:00

25 lines
621 B
JavaScript

import mdx from '@astrojs/mdx';
import { expect } from 'chai';
import { parseHTML } from 'linkedom';
import { loadFixture } from '../../../astro/test/test-utils.js';
describe('MDX and React', () => {
let fixture;
before(async () => {
fixture = await loadFixture({
root: new URL('./fixtures/mdx-plus-react/', import.meta.url),
});
await fixture.build();
});
it('can be used in the same project', async () => {
const html = await fixture.readFile('/index.html');
const { document } = parseHTML(html);
const p = document.querySelector('p');
expect(p.textContent).to.equal('Hello world');
});
});