Releases: Tabueeee/puppeteer-request-spy
Releases · Tabueeee/puppeteer-request-spy
RequestModifier And Async Options
Features
- added RequestModifier for request overrides
- allow asynchronous fakes and overrides
- allow callbacks for fakes and overrides
- new type of ResponseFaker: ResponseModifier (load and modify request)
- new type of RequestModifier: RequestRedirector (redirect url of request)
Fixed Errors in Readme
- fixed two errors in readme api usage
credit to Oleg Artene for reporting and fixing the issue in #11
Customizeable Request matching
Feature
Interfaces allow you to create your own Request- Spy/Faker/Blocker to filter responses further or map responses to requests by headers like method.
Changes
- added new class RequestBlocker for more control of which requests are blocked
- introduced interfaces for Request- Spy/Faker/Blocker
- If a request matches is now determined by the Request- Spy/Faker/Blocker
- updated documentation, types and examples
- simplified build-steps
- added contributing information to the repository
Matching Requests from RequestSpy
feature
RequestSpy can now be used to get matching Requests and query them and their responses for further assertions.
Changes
- Minor performance improvement by caching how url should be accessed depending on puppeteer version
- RequestSpy now exposes a function to get all matched Requests
- Minor refactoring in preparation of future feature releases
- Updated typings
- Improved examples
- Updated documentation (to account for puppeteer's API changes)
Bugfix
Bugfix and Documentation
Changes
- fixed
_this
reference error; occured depending on ecmascript version / typescript target - updated typescript type definitions
- improved examples
- improved documentation
Faking responses of intercepted requests
feature
The ResponseFaker can be used to replace the response of any request intercepted by puppeteer.
improvement
- improved build
- added badges
- updated documentation
Support new puppeteer versions
changes:
- fixed
RequestInterceptor
not matching correct url in new puppeteer versions