diff options
author | 2022-08-08 17:33:35 -0500 | |
---|---|---|
committer | 2022-08-08 17:33:35 -0500 | |
commit | 4c2ca5352d0c4119ed2a9e5e0b78ce71eb1b414a (patch) | |
tree | 9d7cc9c2f8fe13f5aa52294f79d67f4a68e3a86b /packages/integrations/mdx/test | |
parent | 36cb503c8a8ea7c312ac408ceac27ab279104a25 (diff) | |
download | astro-4c2ca5352d0c4119ed2a9e5e0b78ce71eb1b414a.tar.gz astro-4c2ca5352d0c4119ed2a9e5e0b78ce71eb1b414a.tar.zst astro-4c2ca5352d0c4119ed2a9e5e0b78ce71eb1b414a.zip |
[MDX] Remove `frontmatterOptions` (#4204)
* feat: remove frontmatterOptions config
* test: remove custom frontmatter suite
* deps: remove remark-mdx-frontmatter
* docs: remove `frontmatterOptions` config
* chore: changeset
Diffstat (limited to 'packages/integrations/mdx/test')
3 files changed, 0 insertions, 32 deletions
diff --git a/packages/integrations/mdx/test/fixtures/mdx-custom-frontmatter-name/src/pages/glob.json.js b/packages/integrations/mdx/test/fixtures/mdx-custom-frontmatter-name/src/pages/glob.json.js deleted file mode 100644 index 2f8155ada..000000000 --- a/packages/integrations/mdx/test/fixtures/mdx-custom-frontmatter-name/src/pages/glob.json.js +++ /dev/null @@ -1,9 +0,0 @@ -export async function get() { - const mdxPages = await import.meta.glob('./*.mdx', { eager: true }); - - return { - body: JSON.stringify({ - titles: Object.values(mdxPages ?? {}).map(v => v?.customFrontmatter?.title), - }) - } -} diff --git a/packages/integrations/mdx/test/fixtures/mdx-custom-frontmatter-name/src/pages/index.mdx b/packages/integrations/mdx/test/fixtures/mdx-custom-frontmatter-name/src/pages/index.mdx deleted file mode 100644 index e3c789149..000000000 --- a/packages/integrations/mdx/test/fixtures/mdx-custom-frontmatter-name/src/pages/index.mdx +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: 'Using YAML frontmatter' -illThrowIfIDontExist: "Oh no, that's scary!" ---- - -# {customFrontmatter.illThrowIfIDontExist} diff --git a/packages/integrations/mdx/test/mdx-frontmatter.test.js b/packages/integrations/mdx/test/mdx-frontmatter.test.js index 5f0316986..e69919bd5 100644 --- a/packages/integrations/mdx/test/mdx-frontmatter.test.js +++ b/packages/integrations/mdx/test/mdx-frontmatter.test.js @@ -56,21 +56,4 @@ describe('MDX frontmatter', () => { expect(headingSlugs).to.contain('section-1'); expect(headingSlugs).to.contain('section-2'); }); - - it('extracts frontmatter to "customFrontmatter" export when configured', async () => { - const customFixture = await loadFixture({ - root: new URL('./fixtures/mdx-custom-frontmatter-name/', import.meta.url), - integrations: [ - mdx({ - frontmatterOptions: { - name: 'customFrontmatter', - }, - }), - ], - }); - await customFixture.build(); - - const { titles } = JSON.parse(await customFixture.readFile('/glob.json')); - expect(titles).to.include('Using YAML frontmatter'); - }); }); |