diff options
author | 2022-08-01 21:25:50 +0000 | |
---|---|---|
committer | 2022-08-01 21:25:50 +0000 | |
commit | 10a8fa5dcd958605deb41f0f5fe8b2f2ee7229b5 (patch) | |
tree | 32b629acb81c0807b908a139118b572ea367ca7f /packages/integrations/mdx/test/mdx-rehype-plugins.test.js | |
parent | 40ef43a59b08a1a8fbcd9f4a53745a9636a4fbb9 (diff) | |
download | astro-10a8fa5dcd958605deb41f0f5fe8b2f2ee7229b5.tar.gz astro-10a8fa5dcd958605deb41f0f5fe8b2f2ee7229b5.tar.zst astro-10a8fa5dcd958605deb41f0f5fe8b2f2ee7229b5.zip |
[ci] format
Diffstat (limited to 'packages/integrations/mdx/test/mdx-rehype-plugins.test.js')
-rw-r--r-- | packages/integrations/mdx/test/mdx-rehype-plugins.test.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/integrations/mdx/test/mdx-rehype-plugins.test.js b/packages/integrations/mdx/test/mdx-rehype-plugins.test.js index bb0c6eb63..d8761b9fb 100644 --- a/packages/integrations/mdx/test/mdx-rehype-plugins.test.js +++ b/packages/integrations/mdx/test/mdx-rehype-plugins.test.js @@ -9,12 +9,12 @@ import { toString } from 'mdast-util-to-string'; import { loadFixture } from '../../../astro/test/test-utils.js'; export function rehypeReadingTime() { - return function (tree) { - const readingTime = getReadingTime(toString(tree)) + return function (tree) { + const readingTime = getReadingTime(toString(tree)); tree.children.unshift( jsToTreeNode(`export const readingTime = ${JSON.stringify(readingTime)}`) - ) - }; + ); + }; } const FIXTURE_ROOT = new URL('./fixtures/mdx-rehype-plugins/', import.meta.url); @@ -37,7 +37,7 @@ describe('MDX rehype plugins', () => { it('removes default getHeadings', async () => { const html = await fixture.readFile('/space-ipsum/index.html'); const { document } = parseHTML(html); - + const headings = [...document.querySelectorAll('h1, h2')]; expect(headings.length).to.be.greaterThan(0); for (const heading of headings) { @@ -47,7 +47,7 @@ describe('MDX rehype plugins', () => { it('supports custom rehype plugins - reading time', async () => { const readingTime = JSON.parse(await fixture.readFile('/reading-time.json')); - + expect(readingTime).to.not.be.null; expect(readingTime.text).to.match(/^\d+ min read/); }); @@ -70,7 +70,7 @@ describe('MDX rehype plugins', () => { it('preserves default getHeadings', async () => { const html = await fixture.readFile('/space-ipsum/index.html'); const { document } = parseHTML(html); - + const headings = [...document.querySelectorAll('h1, h2')]; expect(headings.length).to.be.greaterThan(0); for (const heading of headings) { |