Skip to content

refactor(tests): reuse source map node walker - #101

Merged
luojiyin1987 merged 1 commit into
masterfrom
refactor/reuse-source-map-node-walker
Aug 15, 2026
Merged

refactor(tests): reuse source map node walker#101
luojiyin1987 merged 1 commit into
masterfrom
refactor/reuse-source-map-node-walker

Conversation

@luojiyin1987

Copy link
Copy Markdown
Contributor

What changed

  • Remove the textNodes test helper.
  • Remove the inlineCodeNodes test helper.
  • Remove the codeNodes test helper.
  • Route all matching lookups through nodesOfType.

Why

The four helpers implemented the same recursive AST traversal.

One generic helper removes duplicate test infrastructure.

Impact

Test coverage and runtime behavior do not change.

Splitting source-map.spec.ts remains a separate follow-up change.

Validation

  • pnpm run lint
  • pnpm test
  • pnpm exec tsc --noEmit

All 1,961 tests pass.

Replace three specialized AST walkers with nodesOfType.
@luojiyin1987
luojiyin1987 marked this pull request as ready for review August 15, 2026 03:24
@luojiyin1987
luojiyin1987 merged commit 8ce3337 into master Aug 15, 2026
13 checks passed
@luojiyin1987
luojiyin1987 deleted the refactor/reuse-source-map-node-walker branch August 15, 2026 03:24
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