Skip to content

refactor(tests): split source-map spec by functional domain - #106

Merged
luojiyin1987 merged 1 commit into
masterfrom
refactor/split-source-map-spec
Aug 23, 2026
Merged

refactor(tests): split source-map spec by functional domain#106
luojiyin1987 merged 1 commit into
masterfrom
refactor/split-source-map-spec

Conversation

@luojiyin1987

Copy link
Copy Markdown
Contributor

Summary

Split the 52 KB __tests__/source-map.spec.ts (1273 lines, 150 tests) into 9 spec files under __tests__/source-map/, one per functional domain. This is the follow-up promised in #101 ("Splitting source-map.spec.ts remains a separate follow-up change").

The production code already modularized into build-source-map.ts, code-segments.ts, recording-extension.ts, errors.ts, and types.ts. The tests now match that shape.

Layout

File Domain
supported-fields.spec.ts documented supported fields smoke
text.spec.ts text.value mapping + non-contiguous ranges
inline-code.spec.ts inlineCode.value
code.spec.ts code.value
url.spec.ts link / definition url fields
range-contract.spec.ts range semantics: atomicity, zero-length points, line/column, argument validation
ownership.spec.ts split siblings and owned-but-unmapped nodes
errors.spec.ts error lifecycle + range resolution regression matrix
ast-parity.spec.ts parseMd vs parseMdWithSourceMap parity corpus

Guarantees

  • Zero runtime change and zero public API change.
  • Describe titles are byte-identical; only file paths change in test reports.
  • Test bodies moved verbatim. The only edits are import paths (./helpers../helpers) and two inline require('./helpers') calls in parity tests converted to normal imports.
  • The existing 4 specs in __tests__/source-map/ are untouched.

Verification

Before: 14 suites / 1961 tests. After: 22 suites (−1 +9) / 1961 tests, zero failures. test:types passes.

@luojiyin1987
luojiyin1987 merged commit c210382 into master Aug 23, 2026
13 checks passed
@luojiyin1987
luojiyin1987 deleted the refactor/split-source-map-spec branch August 23, 2026 04:23
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