diff options
author | 2023-01-03 16:31:19 -0500 | |
---|---|---|
committer | 2023-01-03 16:31:19 -0500 | |
commit | e2019be6ffa46fa33d92cfd346f9ecbe51bb7144 (patch) | |
tree | 413c13945ae992c26111e78314a567f5c0136c67 /packages/integrations/mdx/test/mdx-frontmatter-injection.test.js | |
parent | 16c7d0bfd49d2b9bfae45385f506bcd642f9444a (diff) | |
download | astro-e2019be6ffa46fa33d92cfd346f9ecbe51bb7144.tar.gz astro-e2019be6ffa46fa33d92cfd346f9ecbe51bb7144.tar.zst astro-e2019be6ffa46fa33d92cfd346f9ecbe51bb7144.zip |
Change frontmatter injection ordering (#5687)
* feat: make user frontmatter accessible in md
* test: new frontmatter injection
* refactor: move injection utils to remark pkg
* fix: add dist/internal to remark exports
* feat: update frontmater injection in mdx
* tests: new mdx injection
* chore: changeset
* chore: simplify frontmatter destructuring
* fix: remove old _internal references
* refactor: injectedFrontmatter -> remarkPluginFrontmatter
* docs: add content collections change
* chore: changeset heading levels
Diffstat (limited to 'packages/integrations/mdx/test/mdx-frontmatter-injection.test.js')
-rw-r--r-- | packages/integrations/mdx/test/mdx-frontmatter-injection.test.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/packages/integrations/mdx/test/mdx-frontmatter-injection.test.js b/packages/integrations/mdx/test/mdx-frontmatter-injection.test.js index 780f7252c..8f598b78e 100644 --- a/packages/integrations/mdx/test/mdx-frontmatter-injection.test.js +++ b/packages/integrations/mdx/test/mdx-frontmatter-injection.test.js @@ -33,14 +33,11 @@ describe('MDX frontmatter injection', () => { } }); - it('overrides injected frontmatter with user frontmatter', async () => { + it('allow user frontmatter mutation', async () => { const frontmatterByPage = JSON.parse(await fixture.readFile('/glob.json')); - const readingTimes = frontmatterByPage.map( - (frontmatter = {}) => frontmatter.injectedReadingTime?.text - ); - const titles = frontmatterByPage.map((frontmatter = {}) => frontmatter.title); - expect(titles).to.contain('Overridden title'); - expect(readingTimes).to.contain('1000 min read'); + const descriptions = frontmatterByPage.map((frontmatter = {}) => frontmatter.description); + expect(descriptions).to.contain('Processed by remarkDescription plugin: Page 1 description'); + expect(descriptions).to.contain('Processed by remarkDescription plugin: Page 2 description'); }); it('passes injected frontmatter to layouts', async () => { |