forwardemail

forwardemail/supertest

JavaScript MIT Dev Tools

🕷 Super-agent driven library for testing node.js HTTP servers using a fluent API. Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.

14.4k stars
782 forks
slow
GitHub +9 / week

14.4k

Stars

782

Forks

187

Open issues

30

Contributors

v7.2.2 06 Jan 2026

AI Analysis

Supertest is a high-level HTTP assertion library for testing Node.js servers, built on top of superagent and providing a fluent API for writing test assertions. It serves developers building HTTP-based applications who need to validate server behavior in test suites. It is specifically designed for Node.js HTTP testing and is not a general-purpose tool—it integrates with test frameworks like Mocha but is primarily used by developers testing Express, Koa, and similar server frameworks.

Dev Tools Testing Tool Discovery value: 2/10
Documentation 8/10
Activity 6/10
Community 8/10
Code quality 8/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

http-testing node.js superagent test-assertions fluent-api
Popular Well documented MIT licensed Actively maintained Beginner friendly Production ready
Deep Analysis · Based on README and public signals
2w ago

Supertest: the de facto HTTP integration testing library for Node.js, now maintained by Forward Email

Supertest provides a fluent, chainable API for firing HTTP requests directly against Node.js server instances (Express, Koa, raw http, etc.) without needing a running network listener. It wraps superagent to add assertion helpers, making it easy to assert status codes, headers, and response bodies in a single chain. Originally created by TJ Holowaychuk and now maintained by the Forward Email / Lad.js ecosystem, it is a standard dependency in millions of Node.js projects. Its primary audience is backend and full-stack JavaScript developers who want lightweight integration tests without spinning up a full server.

Origin

Created in June 2012 by TJ Holowaychuk as a companion to superagent. Ownership transferred to the ladjs/forwardemail org when original maintainers moved on. Has accumulated 14k+ stars over 13 years of continuous use.

Growth

Growth was driven largely by the dominance of Express.js in the Node.js ecosystem during 2013–2018; supertest became the go-to testing tool for Express apps. Adoption compounded through inclusion in countless tutorials, boilerplates, and course curricula. Star growth has plateaued (10 stars/week as of mid-2026) reflecting saturation of a mature, stable niche rather than decline — it is already embedded in a large installed base.

In production

14,377 GitHub stars and 782 forks across 13 years. The npm package 'supertest' has been one of the most downloaded Node.js testing packages for years — public npm download data historically shows tens of millions of weekly downloads, though current figures cannot be confirmed from available metadata alone. Explicit organizational use by Forward Email and the Lad.js family of projects is documented in the README. Widely referenced in Node.js testing tutorials and official framework documentation.

Code analysis
Architecture

Appears to be a thin wrapper around superagent: the request() function accepts an http.Server or Express app, binds it to an ephemeral port if not already listening, and returns a superagent Request object augmented with .expect() assertion methods. Likely minimal own logic, delegating HTTP mechanics entirely to superagent. HTTP/2 support is exposed via an options argument, suggesting relatively recent extension of the core pattern.

Tests

Code coverage badge linked to Codecov is present in the README, suggesting automated coverage tracking exists, though the actual percentage is not stated in the README excerpt.

Maintenance

Last push was 2026-04-02, approximately 12 weeks before the analysis date — indicating active maintenance. The repo is explicitly listed as maintained for multiple production projects (forwardemail, ladjs, spamscanner, breejs, cabinjs, lassjs), giving it organizational backing. CI is run via GitHub Actions. This is slow-moving but clearly not stagnant.

Honest verdict

ADOPT IF: you are building or maintaining a Node.js HTTP server (especially Express/Koa) and want a minimal, well-understood integration testing tool with no additional infrastructure. AVOID IF: you are starting a new project with a framework that provides first-party test injection (e.g., Fastify's inject, Hono's testClient), or you need full E2E browser simulation. MONITOR IF: you are evaluating whether the superagent dependency (also maintained by the same org) keeps pace with modern fetch-based HTTP standards, as that is the primary long-term dependency risk.

Independent dimensions

Mainstream potential

4/10

Technical importance

7/10

Adoption evidence

9/10

Risks
  • Supertest's core dependency is superagent, which is also a legacy library facing relevance pressure from native fetch and newer HTTP clients; if superagent falls behind, supertest inherits the problem.
  • The project is now primarily maintained as an internal dependency of one organization (Forward Email / Lad.js); bus factor risk exists if that organization's priorities shift.
  • Framework-native test utilities in newer Node.js frameworks (Fastify, Hono, Elysia) may reduce the need for a separate testing abstraction in greenfield projects.
  • The fluent API's error handling with .end() callbacks is a known footgun (assertions that fail silently), and migrating users to promise/async patterns requires ongoing documentation effort.
  • Slow star growth and low weekly delta (10/week) may discourage adoption by teams using star count as a proxy for community health, even though the project is functionally stable.
Prediction

Supertest will remain a dominant testing utility for the large existing base of Express/Koa applications for years, but its share of new project adoption will gradually decline as framework-native test tooling matures.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

JavaScript
100%

Information

Language
JavaScript
License
MIT
Last updated
3mo ago
Created
171mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

forwardemail

forwardemail/superagent

Superagent is a lightweight HTTP client library (~50 KB minified+gzipped) that...

16.7k JavaScript Web Dev
codeceptjs

codeceptjs/CodeceptJS

CodeceptJS is an end-to-end testing framework for Node.js that abstracts...

4.2k JavaScript Dev Tools
supabase

supabase/supabase-js

Supabase-js is the official JavaScript SDK for Supabase, an open-source...

4.5k TypeScript Web Dev
flightcontrolhq

flightcontrolhq/superjson

Superjson safely serializes JavaScript objects containing non-JSON types...

5.3k TypeScript Web Dev
superagent-ai

superagent-ai/superagent

Superagent is an open-source SDK that protects AI applications against prompt...

6.7k TypeScript Security
vs. alternatives
node-fetch / undici + assert (manual)

Lower-level approach with no fluent assertion API; supertest provides more ergonomic DX for HTTP assertions without additional setup.

axios-mock-adapter

Mocks HTTP at the client level rather than testing a real server handler; supertest actually invokes the server, making it better for true integration coverage.

Playwright / Supertest via APIRequestContext

Playwright's API testing mode offers similar HTTP assertions but is heavier and primarily aimed at teams already using Playwright for E2E browser tests.

Hono testClient / framework-native test helpers

Newer frameworks (Hono, Fastify inject) provide first-party lightweight test utilities that may reduce need for supertest in greenfield projects outside Express.

jest-supertest / vitest ecosystem wrappers

Various thin wrappers exist to improve DX inside Jest/Vitest environments, but they depend on supertest itself rather than replacing it.