Netflix/pollyjs ? reverse-engineered prompt
Reverse engineered prompt
Build me a JavaScript library that can record, replay, and stub HTTP requests in both Node and the browser.
I want it to work with common request APIs like fetch and XHR, and let me easily switch between recording real responses and replaying them later so tests run fast and stay deterministic. It should also let me intercept specific requests, return custom responses, pass some requests through to the network, and expose simple events for request handling.
Please include a clean API that feels easy to use in tests, plus helpers for Mocha and QUnit style test setups. I’d like support for saving recordings to disk or local storage, and the recordings should be stored in a HAR like format. If you need to look up current docs or examples online, go ahead. Make the project feel polished, documented, and ready for real world testing workflows.
Are you gonna build this?
make sure you review the code using coderabbit