diff options
Diffstat (limited to 'packages/integrations/mdx/test/mdx-syntax-highlighting.test.js')
-rw-r--r-- | packages/integrations/mdx/test/mdx-syntax-highlighting.test.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/packages/integrations/mdx/test/mdx-syntax-highlighting.test.js b/packages/integrations/mdx/test/mdx-syntax-highlighting.test.js index 32c6bcd04..d420faabc 100644 --- a/packages/integrations/mdx/test/mdx-syntax-highlighting.test.js +++ b/packages/integrations/mdx/test/mdx-syntax-highlighting.test.js @@ -67,6 +67,32 @@ describe('MDX syntax highlighting', () => { const prismCodeBlock = document.querySelector('pre.language-astro'); expect(prismCodeBlock).to.not.be.null; }); + + for (const extendMarkdownConfig of [true, false]) { + it(`respects syntaxHighlight when extendMarkdownConfig = ${extendMarkdownConfig}`, async () => { + const fixture = await loadFixture({ + root: FIXTURE_ROOT, + markdown: { + syntaxHighlight: 'shiki', + }, + integrations: [ + mdx({ + extendMarkdownConfig, + syntaxHighlight: 'prism', + }), + ], + }); + await fixture.build(); + + const html = await fixture.readFile('/index.html'); + const { document } = parseHTML(html); + + const shikiCodeBlock = document.querySelector('pre.astro-code'); + expect(shikiCodeBlock, 'Markdown config syntaxHighlight used unexpectedly').to.be.null; + const prismCodeBlock = document.querySelector('pre.language-astro'); + expect(prismCodeBlock).to.not.be.null; + }); + } }); it('supports custom highlighter - shiki-twoslash', async () => { |