Skip to content

test(spec): use parsed AST to detect keys order mismatch#37

Merged
farnabaz merged 2 commits intomainfrom
test/spec-improvements
Mar 6, 2026
Merged

test(spec): use parsed AST to detect keys order mismatch#37
farnabaz merged 2 commits intomainfrom
test/spec-improvements

Conversation

@larbish
Copy link
Contributor

@larbish larbish commented Mar 5, 2026

The SPEC tests for HTML and Markdown rendering were using the stored AST snapshot instead of the actual parse() output. Since toEqual ignores key order, ordering mismatches between parse() and the snapshot went undetected

The AST test passed, but the rendering tests never saw what parse() really produced.

Fix: move parse() into a beforeAll shared across all blocks, so HTML and Markdown are rendered from the actual parse output.

This exposed stale snapshots in 6 SPEC files (wrong attribute order in HTML, wrong key order in frontmatter, duplicate key in AST) which are corrected in this PR.

@vercel
Copy link

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comark Ready Ready Preview Mar 6, 2026 8:51am

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 5, 2026

Open in StackBlitz

npm i https://pkg.pr.new/comarkdown/comark@37
npm i https://pkg.pr.new/comarkdown/comark/@comark/cjk@37
npm i https://pkg.pr.new/comarkdown/comark/@comark/math@37
npm i https://pkg.pr.new/comarkdown/comark/@comark/mermaid@37

commit: 127e11b

@farnabaz farnabaz merged commit 26889d4 into main Mar 6, 2026
2 of 3 checks passed
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.

3 participants