Skip to content

test: mdx rehype plugin - #48

Open
peppermintc wants to merge 1 commit into
mintlify:mainfrom
peppermintc:peppermintc/test-rehype-plugin
Open

test: mdx rehype plugin#48
peppermintc wants to merge 1 commit into
mintlify:mainfrom
peppermintc:peppermintc/test-rehype-plugin

Conversation

@peppermintc

@peppermintc peppermintc commented Jan 21, 2026

Copy link
Copy Markdown

Summary

  • rehype plugin test to check refactoring code changes
  • unit test and snapshot test is added
  • dev dependencies added for snapshot test

Test Command

  • open terminal at mdx/packages/mdx
  • yarn install
  • yarn test

Test Details

Unit Test

  • checks if pre node gets properties as expected after running rehype plugin

Snapshot Test

  • checks syntax highlighting, twoslash and link support
  • snapshot test can ensure markdown to HTML is working as before, this can determine correct classnames and metadata are created on the rehype plugin hast result

Fixture File Types

  • .md: input markdown file
  • .out.html: output HTML file
  • mock-hast-tree: basic mock hast data
  • fixtures are referenced from examples/highlight-example.mdx

Reference

Demo

test-rehype.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant