#2948·nock

DX improvement request

Author: nanotowerCreated Mar 6, 2026Updated Mar 6, 2026
Labelsfeature

Please avoid duplicates

Context

When using nock v14 with Jest's default module re-evaluation, nock gets loaded multiple times per process, stacking @mswjs/interceptors proxy layers on http. This causes intermittent failures. Please, consider documenting the recommended Jest setup (e.g., moduleNameMapper or setupFiles singleton pattern).

Alternatives

In my case, I shared the same nock for all tests instead of one per each. With 40+ tests it's really tricky having intermittent errors now and then.

If the feature request is accepted, would you be willing to submit a PR?

  • yes