https://github.com/nsaunders/xhr2-test
Monkey-patch the xhr2 library for testing
https://github.com/nsaunders/xhr2-test
Last synced: about 1 month ago
JSON representation
Monkey-patch the xhr2 library for testing
- Host: GitHub
- URL: https://github.com/nsaunders/xhr2-test
- Owner: nsaunders
- License: mit
- Created: 2018-04-09T15:47:44.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-24T23:12:07.000Z (about 7 years ago)
- Last Synced: 2025-10-11T17:13:59.496Z (8 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xhr2-test
Monkey-patch the xhr2 library for testing.
If you are using xhr2 to test your AJAX code in a Node context, then this tool might be for you. It allows you to add an
arbitrary prefix to any URL requested by xhr2. Most likely, you would use this to forward all requests to a test server
that provides a known response for a given request.
For example, if your code makes a request to https://api.foo.ly/bar, you can run ```xhr2-test http://localhost:8080/```
to send the request to http://localhost:8080/https://api.foo.ly/bar instead.