diff options
author | 2022-08-05 17:13:30 -0400 | |
---|---|---|
committer | 2022-08-05 17:13:30 -0400 | |
commit | 8eb3a8c6d9554707963c3a3bc36ed8b68d3cf0fb (patch) | |
tree | be1e8837eea876448761e7852f934757751329dd /packages/integrations/mdx/test/mdx-plus-react.test.js | |
parent | 14d27c1d6f8f9d7143547bf330398bbc6a5ee4f4 (diff) | |
download | astro-8eb3a8c6d9554707963c3a3bc36ed8b68d3cf0fb.tar.gz astro-8eb3a8c6d9554707963c3a3bc36ed8b68d3cf0fb.tar.zst astro-8eb3a8c6d9554707963c3a3bc36ed8b68d3cf0fb.zip |
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>
Diffstat (limited to 'packages/integrations/mdx/test/mdx-plus-react.test.js')
-rw-r--r-- | packages/integrations/mdx/test/mdx-plus-react.test.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/integrations/mdx/test/mdx-plus-react.test.js b/packages/integrations/mdx/test/mdx-plus-react.test.js new file mode 100644 index 000000000..49c25d558 --- /dev/null +++ b/packages/integrations/mdx/test/mdx-plus-react.test.js @@ -0,0 +1,25 @@ +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'); + }); +}); |