Skip to content

test(editor): add fixture based markdown round trip tests - #3626

Open
JammingBen wants to merge 6 commits into
fix/tiptap-md-issuesfrom
test/tiptap-md-fixtures
Open

JammingBen wants to merge 6 commits into
fix/tiptap-md-issuesfrom
test/tiptap-md-fixtures

Conversation

@JammingBen

@JammingBen JammingBen commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Description

Stacked on #3614.

Moves the markdown round trip tests of the text editor to fixture files in packages/web-pkg/tests/unit/editor/strategies/fixtures/markdown/. This makes them more transparent while also providing files a dev can work with. Adding a case now means adding a .md file.

Each fixture is checked for:

  • exact output: the saved markdown equals the fixture, or <name>.out.md
  • stability: saving the saved markdown again changes nothing
  • rendering: marked renders the original and the saved markdown the same

Fixtures in unlike-marked/ skip the render check, since the editor reads them differently from marked on purpose (empty item below text, task syntax in ordered lists, under or tab indented content below task items, indented tilde fence, list starting at 0).

Also:

  • registers the markdown tokenizers on a Marked instance type instead of typeof marked
  • moves the shared test helpers to helpers.ts
  • keeps only the inline tests that can't be fixtures (editor document input, parsed document checks, performance, Marked instance)

Issue

fixes #3620

@JammingBen
JammingBen added this pull request to stack #3619 October 9, 2026 09:25
@JammingBen
JammingBen force-pushed the test/tiptap-md-fixtures branch from f71b096 to be724fb Compare October 9, 2026 09:55
@JammingBen
JammingBen force-pushed the test/tiptap-md-fixtures branch from be724fb to 81aee3a Compare October 9, 2026 10:19
@JammingBen
JammingBen marked this pull request as ready for review October 9, 2026 11:06
@JammingBen JammingBen self-assigned this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fixture-based round trip tests for the markdown editor

2 participants