Skip to content

test: add source-level Jest coverage - #153

Merged
luojiyin1987 merged 1 commit into
masterfrom
test/source-coverage
Nov 4, 2026
Merged

luojiyin1987 merged 1 commit into
masterfrom
test/source-coverage

Conversation

@luojiyin1987

Copy link
Copy Markdown
Contributor

Problem

Existing Jest tests load the built parser from dist/. Their coverage does not measure the TypeScript source directly.

Changes

  • Add a separate Jest configuration for direct TypeScript source tests.
  • Add 10 tests for Markdown, MDX, source ranges, code blocks, and source-map errors.
  • Keep the 27 existing build-level Jest suites.
  • Add V8 source coverage on Node.js 22 in CI.
  • Leave coverage thresholds unset while the baseline is reviewed.

Validation

  • Remove dist/, then run pnpm run test:source: 10 tests pass.
  • Run pnpm run test:coverage: source files appear in the report.
  • Run pnpm test: 2024 existing tests and 10 source tests pass.
  • Check API reports: no changes.
  • Run git diff --check: no errors.

Local coverage on Node.js 24 is 79.67% lines and 67.22% branches. The report records 67.99% lines in build-source-map.ts. CI will run coverage on Node.js 22.

No sensitive data was added or redacted.

Closes #152

@luojiyin1987
luojiyin1987 merged commit f3eafea into master Nov 4, 2026
14 checks passed
@luojiyin1987
luojiyin1987 deleted the test/source-coverage branch November 4, 2026 03:28
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.

test: establish source-level coverage baseline

1 participant