Skip to content

fix(types): export MockAgent pending interceptor type#5565

Open
tianrking wants to merge 1 commit into
nodejs:mainfrom
tianrking:agent/export-pending-interceptor-type
Open

fix(types): export MockAgent pending interceptor type#5565
tianrking wants to merge 1 commit into
nodejs:mainfrom
tianrking:agent/export-pending-interceptor-type

Conversation

@tianrking

Copy link
Copy Markdown

Summary

  • expose PendingInterceptor through the MockAgent namespace
  • make pendingInterceptors() and its formatter reference the public namespaced types
  • verify the public annotation in the TypeScript declaration tests

Why

MockAgent#pendingInterceptors() returned a declaration-private interface, so consumers could inspect the values but could not name the return element type in their own TypeScript APIs. The existing mock-agent type test had to duplicate that interface locally.

Validation

  • npx tsd
  • npx tsc test/imports/undici-import.ts --typeRoots ./types --noEmit
  • npx tsc <all types/*.d.ts files> --noEmit --typeRoots ./types
  • npm run lint -- --no-cache

Fixes #5563

@codecov-commenter

codecov-commenter commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.47%. Comparing base (87270e4) to head (61252ed).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5565   +/-   ##
=======================================
  Coverage   93.47%   93.47%           
=======================================
  Files         110      110           
  Lines       37507    37507           
=======================================
  Hits        35059    35059           
  Misses       2448     2448           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

d.ts: Export PendingInterceptor type from mock-agent.d.ts

3 participants