Skip to content

test(markdown-toolkit): remove tests that repeat another test's assertion - #213

Closed
Jason3S wants to merge 2 commits into
mainfrom
claude/md-test-cleanup-b2ace9
Closed

Jason3S wants to merge 2 commits into
mainfrom
claude/md-test-cleanup-b2ace9

Conversation

@Jason3S

@Jason3S Jason3S commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the tests of markdown-toolkit that only repeat an assertion another test already makes, so the suite is
shorter to read. Nothing a remaining test doesn't already check is lost: 741 tests become 736.

A test counts as a repeat here when it calls the same function, reaches the same branch and expects the same result
as a test that stays. The only difference is a value the code doesn't look at, or one that another test already pins.

What was removed

Error tests that pass another block to a builder already tested with one

  • A multi-line comment in a paragraph, a definition term and a heading. The comment table already pins that a
    multi-line comment is a block, and each of the three builders keeps its own test that a block is rejected.
  • A multi-line comment as a details summary. The test with a list as the summary stays.

Assertions written twice

  • The test "an empty replacement leaves no paragraph" was in template.test.ts twice, word for word.
  • p(' ') giving   was asserted by a table row and again by a test below it.
  • document('a', '\nb') had the same row in render.test.ts and document.test.ts.
  • document('a', parse(''), 'b') had a row in document.test.ts and the same assertion in parse.test.ts.

Not in this PR

Tests that resemble another test but differ in something the code does look at stay: the same rule through another
function, several wrong values for one check, or a @ts-expect-error that also checks the types.

…tion

Each removed test or row called the same function, reached the same branch and expected the same result as a
test that stays.
@Jason3S

Jason3S commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Closing: removing repeated tests saves about half a percent of the suite, which is not worth the review.

@Jason3S Jason3S closed this Nov 22, 2026
@Jason3S
Jason3S deleted the claude/md-test-cleanup-b2ace9 branch November 22, 2026 17:43
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