zimicjs / zimic

TypeScript-first HTTP request mocking
https://npmjs.com/package/zimic
MIT License
9 stars 2 forks source link

Show warning if the number of saved requests exceeds a safe limit #349

Open diego-aquino opened 2 months ago

diego-aquino commented 2 months ago

A memory leak will happen if users use saveRequests: true and forget to call interceptor.clear() regularly (i.e. afterEach). We could show a warning in the console if the number of saved intercepted requests exceeds a safe limit. The limit should be configurable per interceptor and default to all interceptors.