diff options
Diffstat (limited to 'packages/integrations/mdx/test')
12 files changed, 34 insertions, 34 deletions
diff --git a/packages/integrations/mdx/test/invalid-mdx-component.test.js b/packages/integrations/mdx/test/invalid-mdx-component.test.js index 4e68fea64..b8152e89c 100644 --- a/packages/integrations/mdx/test/invalid-mdx-component.test.js +++ b/packages/integrations/mdx/test/invalid-mdx-component.test.js @@ -32,7 +32,7 @@ describe('MDX component with runtime error', () => { assert.ok(error); assert.match( error?.hint, - /This issue often occurs when your MDX component encounters runtime errors/ + /This issue often occurs when your MDX component encounters runtime errors/, ); }); }); diff --git a/packages/integrations/mdx/test/mdx-astro-markdown-remarkRehype.test.js b/packages/integrations/mdx/test/mdx-astro-markdown-remarkRehype.test.js index e29efa45b..07197e0e5 100644 --- a/packages/integrations/mdx/test/mdx-astro-markdown-remarkRehype.test.js +++ b/packages/integrations/mdx/test/mdx-astro-markdown-remarkRehype.test.js @@ -25,7 +25,7 @@ describe('MDX with Astro Markdown remark-rehype config', () => { assert.equal(document.querySelector('#footnote-label').textContent, 'Catatan kaki'); assert.equal( document.querySelector('.data-footnote-backref').getAttribute('aria-label'), - 'Kembali ke konten' + 'Kembali ke konten', ); }); @@ -54,7 +54,7 @@ describe('MDX with Astro Markdown remark-rehype config', () => { assert.equal(document.querySelector('#footnote-label').textContent, 'Catatan kaki'); assert.equal( document.querySelector('.data-footnote-backref').getAttribute('aria-label'), - 'Kembali ke konten' + 'Kembali ke konten', ); }); @@ -83,7 +83,7 @@ describe('MDX with Astro Markdown remark-rehype config', () => { assert.equal(document.querySelector('#footnote-label').textContent, 'Catatan kaki'); assert.equal( document.querySelector('.data-footnote-backref').getAttribute('aria-label'), - 'Back to reference 1' + 'Back to reference 1', ); }); }); diff --git a/packages/integrations/mdx/test/mdx-frontmatter-injection.test.js b/packages/integrations/mdx/test/mdx-frontmatter-injection.test.js index 90ec45e4e..5c8b69d07 100644 --- a/packages/integrations/mdx/test/mdx-frontmatter-injection.test.js +++ b/packages/integrations/mdx/test/mdx-frontmatter-injection.test.js @@ -25,7 +25,7 @@ describe('MDX frontmatter injection', () => { it('rehype supports custom vfile data - reading time', async () => { const frontmatterByPage = JSON.parse(await fixture.readFile('/glob.json')); const readingTimes = frontmatterByPage.map( - (frontmatter = {}) => frontmatter.injectedReadingTime + (frontmatter = {}) => frontmatter.injectedReadingTime, ); assert.equal(readingTimes.length > 0, true); for (let readingTime of readingTimes) { @@ -39,11 +39,11 @@ describe('MDX frontmatter injection', () => { const descriptions = frontmatterByPage.map((frontmatter = {}) => frontmatter.description); assert.equal( descriptions.includes('Processed by remarkDescription plugin: Page 1 description'), - true + true, ); assert.equal( descriptions.includes('Processed by remarkDescription plugin: Page 2 description'), - true + true, ); }); diff --git a/packages/integrations/mdx/test/mdx-frontmatter.test.js b/packages/integrations/mdx/test/mdx-frontmatter.test.js index 3fcbf28e8..df36a2439 100644 --- a/packages/integrations/mdx/test/mdx-frontmatter.test.js +++ b/packages/integrations/mdx/test/mdx-frontmatter.test.js @@ -50,7 +50,7 @@ describe('MDX frontmatter', () => { const { document } = parseHTML(html); const headingSlugs = [...document.querySelectorAll('[data-headings] > li')].map( - (el) => el.textContent + (el) => el.textContent, ); assert.equal(headingSlugs.length > 0, true); @@ -70,7 +70,7 @@ describe('MDX frontmatter', () => { assert.equal( frontmatterFile?.endsWith('with-headings.mdx'), true, - '"file" prop does not end with correct path or is undefined' + '"file" prop does not end with correct path or is undefined', ); assert.equal(frontmatterUrl, '/with-headings'); assert.equal(file, frontmatterFile); diff --git a/packages/integrations/mdx/test/mdx-get-headings.test.js b/packages/integrations/mdx/test/mdx-get-headings.test.js index 29bb427cc..4de8b0a6e 100644 --- a/packages/integrations/mdx/test/mdx-get-headings.test.js +++ b/packages/integrations/mdx/test/mdx-get-headings.test.js @@ -43,7 +43,7 @@ describe('MDX getHeadings', () => { { depth: 3, slug: 'subsection-1', text: 'Subsection 1' }, { depth: 3, slug: 'subsection-2', text: 'Subsection 2' }, { depth: 2, slug: 'section-2', text: 'Section 2' }, - ]) + ]), ); }); @@ -59,7 +59,7 @@ describe('MDX getHeadings', () => { }, { depth: 2, slug: 'h2title', text: 'h2Title' }, { depth: 3, slug: 'h3title', text: 'h3Title' }, - ]) + ]), ); }); }); @@ -100,7 +100,7 @@ describe('MDX heading IDs can be customized by user plugins', () => { const headingIDs = document.querySelectorAll('h1,h2,h3').map((el) => el.id); assert.equal( JSON.stringify(headingIDs), - JSON.stringify(Array.from({ length: headingIDs.length }, (_, idx) => String(idx))) + JSON.stringify(Array.from({ length: headingIDs.length }, (_, idx) => String(idx))), ); }); @@ -114,7 +114,7 @@ describe('MDX heading IDs can be customized by user plugins', () => { { depth: 3, slug: '2', text: 'Subsection 1' }, { depth: 3, slug: '3', text: 'Subsection 2' }, { depth: 2, slug: '4', text: 'Section 2' }, - ]) + ]), ); }); }); @@ -194,7 +194,7 @@ describe('MDX headings with frontmatter', () => { { depth: 4, slug: 'item-2', text: 'Item 2' }, { depth: 5, slug: 'nested-item-3', text: 'Nested Item 3' }, { depth: 6, slug: 'frontmatterunknown', text: 'frontmatter.unknown' }, - ]) + ]), ); }); }); diff --git a/packages/integrations/mdx/test/mdx-get-static-paths.test.js b/packages/integrations/mdx/test/mdx-get-static-paths.test.js index 845676f8f..96f0dc9a4 100644 --- a/packages/integrations/mdx/test/mdx-get-static-paths.test.js +++ b/packages/integrations/mdx/test/mdx-get-static-paths.test.js @@ -28,7 +28,7 @@ describe('getStaticPaths', () => { assert.equal( $('#file').text().includes('fixtures/mdx-get-static-paths/src/content/1.mdx'), true, - 'file is included' + 'file is included', ); }); }); diff --git a/packages/integrations/mdx/test/mdx-math.test.js b/packages/integrations/mdx/test/mdx-math.test.js index 908a88e11..5352eca68 100644 --- a/packages/integrations/mdx/test/mdx-math.test.js +++ b/packages/integrations/mdx/test/mdx-math.test.js @@ -32,7 +32,7 @@ describe('MDX math', () => { assert.equal( mjxStyle.includes('mjx-container[jax="SVG"]'), true, - 'style should not be html-escaped' + 'style should not be html-escaped', ); }); @@ -66,7 +66,7 @@ describe('MDX math', () => { assert.equal( mjxStyle.includes('mjx-container[jax="CHTML"]'), true, - 'style should not be html-escaped' + 'style should not be html-escaped', ); }); }); diff --git a/packages/integrations/mdx/test/mdx-optimize.test.js b/packages/integrations/mdx/test/mdx-optimize.test.js index f504a49c9..47acfdff8 100644 --- a/packages/integrations/mdx/test/mdx-optimize.test.js +++ b/packages/integrations/mdx/test/mdx-optimize.test.js @@ -21,7 +21,7 @@ describe('MDX optimize', () => { assert.equal(document.querySelector('h1').textContent.includes('MDX page'), true); assert.equal( document.querySelector('p').textContent.includes('I once heard a very inspirational quote:'), - true + true, ); const blockquote = document.querySelector('blockquote.custom-blockquote'); @@ -40,7 +40,7 @@ describe('MDX optimize', () => { assert.equal(document.querySelector('h1').textContent.includes('Astro page'), true); assert.equal( document.querySelector('p').textContent.includes('I once heard a very inspirational quote:'), - true + true, ); const blockquote = document.querySelector('blockquote.custom-blockquote'); diff --git a/packages/integrations/mdx/test/mdx-plugins.test.js b/packages/integrations/mdx/test/mdx-plugins.test.js index 124ec52c1..68ce1e22e 100644 --- a/packages/integrations/mdx/test/mdx-plugins.test.js +++ b/packages/integrations/mdx/test/mdx-plugins.test.js @@ -167,9 +167,9 @@ describe('MDX plugins', () => { assert.equal( selectTocLink( document, - '`remarkToc` plugin applied unexpectedly. Should override Markdown config.' + '`remarkToc` plugin applied unexpectedly. Should override Markdown config.', ), - null + null, ); }); @@ -194,13 +194,13 @@ describe('MDX plugins', () => { assert.equal( quote.textContent.includes('"Smartypants" is -- awesome'), true, - 'Does not respect `markdown.smartypants` option.' + 'Does not respect `markdown.smartypants` option.', ); } else { assert.equal( quote.textContent.includes('“Smartypants” is — awesome'), true, - 'Respects `markdown.smartypants` unexpectedly.' + 'Respects `markdown.smartypants` unexpectedly.', ); } }); diff --git a/packages/integrations/mdx/test/mdx-script-style-raw.test.js b/packages/integrations/mdx/test/mdx-script-style-raw.test.js index 5b276f043..dc4f337bf 100644 --- a/packages/integrations/mdx/test/mdx-script-style-raw.test.js +++ b/packages/integrations/mdx/test/mdx-script-style-raw.test.js @@ -34,14 +34,14 @@ describe('MDX script style raw', () => { assert.equal( scriptContent.includes("console.log('raw script')"), true, - 'script should not be html-escaped' + 'script should not be html-escaped', ); const styleContent = document.getElementById('test-style').innerHTML; assert.equal( styleContent.includes('h1[id="script-style-raw"]'), true, - 'style should not be html-escaped' + 'style should not be html-escaped', ); }); }); @@ -61,14 +61,14 @@ describe('MDX script style raw', () => { assert.equal( scriptContent.includes("console.log('raw script')"), true, - 'script should not be html-escaped' + 'script should not be html-escaped', ); const styleContent = document.getElementById('test-style').innerHTML; assert.equal( styleContent.includes('h1[id="script-style-raw"]'), true, - 'style should not be html-escaped' + 'style should not be html-escaped', ); }); }); diff --git a/packages/integrations/mdx/test/mdx-vite-env-vars.test.js b/packages/integrations/mdx/test/mdx-vite-env-vars.test.js index 4e32d12cb..80a9b1cec 100644 --- a/packages/integrations/mdx/test/mdx-vite-env-vars.test.js +++ b/packages/integrations/mdx/test/mdx-vite-env-vars.test.js @@ -32,7 +32,7 @@ describe('MDX - Vite env vars', () => { document .querySelector('[data-env-site]') ?.innerHTML.includes('https://mdx-is-neat.com/blog/cool-post'), - true + true, ); }); it('Transforms `import.meta.env` in variable exports', async () => { @@ -41,13 +41,13 @@ describe('MDX - Vite env vars', () => { assert.equal( document.querySelector('[data-env-variable-exports]')?.innerHTML.includes('MODE works'), - true + true, ); assert.equal( document .querySelector('[data-env-variable-exports-unknown]') ?.innerHTML.includes('exports: ""'), - true + true, ); }); it('Transforms `import.meta.env` in HTML attributes', async () => { diff --git a/packages/integrations/mdx/test/units/rehype-optimize-static.test.js b/packages/integrations/mdx/test/units/rehype-optimize-static.test.js index 675bc3478..6121975a4 100644 --- a/packages/integrations/mdx/test/units/rehype-optimize-static.test.js +++ b/packages/integrations/mdx/test/units/rehype-optimize-static.test.js @@ -36,7 +36,7 @@ describe('rehype-optimize-static', () => { `\ <_components.h1 {...{ "set:html": "hello" -}} />` +}} />`, ); }); @@ -50,7 +50,7 @@ foo bar jsx, `\ <Fragment set:html="<h1>hello</h1> -<p>foo bar</p>" />` +<p>foo bar</p>" />`, ); }); @@ -66,7 +66,7 @@ This is a <Comp /> jsx, `\ <><Fragment set:html="<h1>hello</h1> -" /><_components.p>{"This is a "}<Comp /></_components.p></>` +" /><_components.p>{"This is a "}<Comp /></_components.p></>`, ); }); @@ -83,7 +83,7 @@ foo <strong>bar</strong> baz `\ <Fragment set:html="<h1>hello</h1> <p>foo <strong>bar</strong> baz</p> -<strong>qux</strong>" />` +<strong>qux</strong>" />`, ); }); }); |