qmetrics.net

supertest

Node.js HTTP server testing via superagent

Supertest offers a fluent API for asserting HTTP behavior against Node.js servers during automated tests. It builds on superagent so you can express status, headers, and body expectations in code.

Overview

Supertest is a Node.js library for testing HTTP servers with high-level request helpers while still allowing lower-level superagent calls when needed. You install it as a development dependency and attach it to an Express-style app, generic HTTP server, or URL.

The request helper binds ephemeral ports when the server is not already listening, shares one server across requests from the same app, and works with common test runners or plain callbacks, promises, and async functions. Options exist to exercise HTTP/2.

Chained expect methods assert status codes, response bodies, and headers, including custom functions. Cookie helpers verify set, reset, and renewal semantics. Multipart uploads and other superagent features remain available.

The design goal is concise HTTP assertions for integration tests without manually tracking ports or reimplementing superagent behavior.

Key features

  • Fluent HTTP expectations
  • Ephemeral port binding
  • Works with any test runner
  • Promise and async support
  • Header and body matchers
  • Cookie assertion helpers
  • HTTP/2 request option
  • Superagent compatibility

Use cases

  • API integration tests
  • Express route testing
  • HTTP header assertions
  • Cookie behavior checks
  • Multipart upload tests

Tags

Similar software

Keploy

Record-and-replay API and integration testing from traffic

Keploy captures API calls, database queries, and streaming events, then replays them as tests and dependency mocks without changing application code.

★ 20k⟳ todayApache-2.0

GoReplay

Capture and replay live HTTP traffic

GoReplay records HTTP from network interfaces and replays it to test servers for shadowing, load testing, and debugging. It runs as a command-line daemon without in-path proxy changes.

★ 19.3k⟳ 1 year agoGPL-3.0 · open core
API Development & TestingNo commits in 18+ monthsDesktop/CLI app

MSW

JavaScript API mocking through network-level request interception

Mock Service Worker lets you define HTTP mocks once and reuse them in browsers and Node.js. Applications keep calling real APIs while responses are substituted at the network layer.

★ 18.4k⟳ 2 days agoMIT

MeterSphere

Open continuous testing platform with built-in AI assistant

MeterSphere is an open continuous testing tool with AI-assisted case generation, test management, and API testing for teams. It uses a system-organization-project hierarchy for collaboration.

★ 13.7k⟳ 1 month agoGPL-3.0

Karate

Unified open-source test automation framework

Karate combines API testing, mocks, performance testing, and UI automation in one framework with a readable syntax. Tests run via JUnit, a CLI, or CI/CD with parallel execution.

★ 9k⟳ 2 days agoMIT

Mockoon

Local desktop and CLI tools for REST API mocking

Mockoon lets you design and run mock HTTP APIs on your machine without cloud accounts. A desktop app handles editing; a CLI runs mocks in CI, Docker, and serverless setups.

★ 8.5k⟳ 2 days agoMIT