Open aryzing opened 2 months ago
If it helps, this is how nock
handles allowing real network requests: https://www.npmjs.com/package/nock?activeTab=readme#enabledisable-real-http-requests
Thanks for pointing this out! The fix is about to be merged in this PR: #18
When adding a single API endpoint
mock()
, any other fetch requests (even to different hosts) will fail. This is impractical for large codebases with many fetch requests, where only one or a few requests need to be mocked. It would be very useful if we could configure the behavior for unmatched requests to use ORIGINAL_FETCH instead. It certainly would help porting large code bases.https://github.com/DRFR0ST/bun-bagel/blob/3793f8233acb981657ea3f243aa110bf6adb2bc0/src/mock.ts#L77-L78
Something like,