Supertest is a Node.js HTTP testing library that provides a framework for making requests and asserting responses from web servers. It functions as an HTTP assertion framework designed to verify status codes, response bodies, and headers during automated server tests.
The library features an ephemeral port server manager that automatically binds servers to random available ports, removing the need for manual port tracking and preventing conflicts during concurrent test execution. It also includes an HTTP session state manager to persist cookies and session data across multiple sequential requests.
Its capabilities cover REST API validation and automated server integration through a fluent interface. The tool supports the verification of cookie state and the persistence of user sessions across a single host.