HTTP server mocking and expectations library for Node.js. Nock can be used to test modules that perform HTTP requests in isolation. For instance, if a module performs HTTP requests to a CouchDB server or makes HTTP requests to the Amazon API, you can test that module in isolation. Nock works by overriding Node's http.request function. Also, it overrides http.ClientRequest too to cover for modules that use it directly.
Features
- The latest version of nock supports all currently maintained Node versions
- When you setup an interceptor for a URL and that interceptor is used, it is removed from the interceptor list
- The request path can be a string, a RegExp or a filter function and you can use any HTTP verb.
- You can specify the request body to be matched as the second argument to the get, post, put or delete specifications
- Nock supports array-style/object-style query parameters
- Access original request and headers
License
MIT LicenseFollow Nock
Other Useful Business Software
Cloud-hosted construction project information management for improved communication, and increased efficiency.
Newforma empowers over 4M professionals and 1,500 AECO firms worldwide by revolutionizing Project Information Management. We transform vast amounts of project data into a meticulously organized, easily accessible, and fully searchable resource—all from a single, centralized platform. From pre-construction to years after completion, Newforma ensures you have the critical information you need at every stage of your projects.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of Nock!