16bugs JavaScript: from Zero to Hero
Log in

JavaScript: from Zero to Hero

#142 node request interceptor

Reported by Volkan Ozcelik · 14 Jul 2018, 05:01

Status
New
Priority
Normal
Assigned to
Volkan Ozcelik
Category
Lessons
Version
None

This code sample, if included anywhere in any module required by a Node js process, will intercept all requests made via the request library and send the

for tests especially.

also note that that's how jest mocks work too.

History

14 Jul 2018, 05:01Volkan Ozcelik submitted the bug