xhr2-test

1.0.3 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i xhr2-test

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

2.94 kB

Total Files

4

Last publish

Collaborators

  • therealnicksaunders