镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

test: mdx rehype plugin - #48

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

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant