start-server-and-test

Starts your dev server, waits for it to respond, runs your test command, then shuts the server down automatically.

Tool
npm
v3.0.12
1,581stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
85/100Excellent
Development Activity92
Maintenance96
Community52
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
65/100Good
Architecture78
Code Quality82
Innovation45
Learning Curve55

start-server-and-test is a small CLI utility built for one specific CI headache: running end-to-end tests against a server that has to be booted first. Instead of hand-writing shell glue to launch a server in the background, poll it until it’s ready, run the test suite, and remember to kill the server afterward, you wire three npm scripts together and let the tool orchestrate the whole sequence.

Under the hood it combines wait-on for HTTP polling with execa for process management and tree-kill for reliably terminating the server (and any child processes it spawned) once tests finish, whether they pass or fail. It supports single or multiple services started in sequence, custom expected HTTP status codes, proxy configuration, and both HEAD and GET-based readiness checks for servers like webpack-dev-server that don’t respond to HEAD requests.

The project is maintained by Gleb Bahmutov (a longtime Cypress core contributor) and is a near-universal dependency in Cypress and Playwright CI setups, with millions of weekly downloads. It ships as start-server-and-test, server-test, and start-test — three aliases for the same binary — and requires no configuration file, only npm script names or shell commands passed as CLI arguments.

What You Get

  • Automatic server lifecycle management - starts the server process, waits for a successful HTTP response before proceeding, and tears it down (including child processes) once tests complete or fail
  • Three interchangeable CLI aliases - start-server-and-test, server-test, and start-test all resolve to the same binary so you can pick whichever reads best in your scripts
  • Multi-service sequencing - start and wait on two servers in sequence (e.g. an API and a frontend) before running tests, using the 5-argument invocation form
  • Configurable readiness checks - override the expected HTTP status code with --expect, force GET instead of HEAD probes with the http-get:// URL prefix, or wait on multiple URLs separated by |
  • Proxy support - route the readiness ping through a proxy host/port with optional username/password authentication
  • Insecure HTTPS mode - disable strict SSL certificate validation via START_SERVER_AND_TEST_INSECURE for self-signed local certs

Common Use Cases

  • Running Cypress or Playwright e2e tests against a locally started dev server in CI
  • Booting a webpack-dev-server or Vite dev server, waiting for the GET-only response, then running a test suite
  • Starting a backend API and a frontend server in sequence before running integration tests against both
  • Testing a server that requires HTTP Basic Auth or returns a non-200 status by design, using --expect
  • Running the same start/wait/test/shutdown sequence identically across local dev machines and CI runners

Under The Hood

Architecture The package is a thin, single-purpose layering: src/bin/start.js parses process.argv via the arg library and hands off to src/index.js’s startAndTest, which recursively walks a services array — starting one server, waiting on its URL with wait-on, then either running the test command (via execa) or recursing into the next service. Cleanup is chained with .finally(stopServer), guaranteeing the server and any child processes are killed through tree-kill regardless of whether the test command succeeds, fails, or throws. src/utils.js is deliberately separated to hold pure parsing/normalization logic (URL/port normalization, npm-script-name detection, quoted-argument reassembly), keeping side-effecting process orchestration isolated from testable pure functions.

Tech Stack Built as a CommonJS Node package (type: commonjs, Node 22/24+ via engines) with a minimal runtime dependency set: execa for child-process spawning, wait-on for HTTP readiness polling, tree-kill for cross-platform process-tree termination, arg for CLI argument parsing, and lazy-ass/check-more-types for lightweight runtime assertions. Prettier handles formatting, Husky wires a pre-commit hook, and renovate.json keeps dependencies patched automatically — reflected in the changelog’s heavy renovate-bot commit volume.

Code Quality Tests run under Mocha with the snap-shot-it snapshot-testing library and sinon/sinon-chai for stubbing, covering both the CLI-argument utilities and the end-to-end startAndTest flow against real fixture servers in test/. CI (GitHub Actions) runs the suite across both ubuntu-latest and windows-latest, plus a battery of npm run demo* scripts that exercise real start/wait/test/shutdown cycles — directly guarding the Windows-specific process-termination error handling in stopServer. Files use @ts-check JSDoc annotations for lightweight type safety without a full TypeScript build step.

What Makes It Unique It doesn’t reimplement HTTP polling or process management — it composes three already-trusted single-purpose packages (wait-on, execa, tree-kill) behind a CLI ergonomic enough to drop into a single npm script line. Its main technical contribution is the recursive multi-service sequencing and the exhaustively handled cross-platform “process already exited” detection in stopServer, covering distinct English, German, and POSIX error signatures — a level of edge-case coverage most hand-rolled CI shell scripts never reach.

Used by 8 apps in this directory

TypeScript
92%
AGPL 3.0

Documenso

Digital Signiture

14,913

Self-hosted, open-source DocuSign alternative with legally binding PDF signatures, multi-party workflows, and a full REST and tRPC API.

View details
93
Repo Health
79
Technical
71
Dependency
Built with
TypeScript92%
Updated today
TypeScript
62%
Other

Flowise

Developer Tools · Automation · No Code Platforms

55,427

Drag-and-drop visual builder for AI agents, RAG pipelines, and multi-agent systems—deploy anywhere in minutes.

View details
86
Repo Health
77
Technical
63
Dependency
Built with
TypeScript62%
JavaScript27%
Updated 3 weeks ago
TypeScript
54%
Other

Focalboard

Productivity · Project Management · Collaboration

26,448

Self-hosted, open source project management with Kanban, table, gallery, and calendar views — a privacy-first alternative to Trello, Notion, and Asana.

View details
57
Repo Health
82
Technical
64
Dependency
Built with
TypeScript54%
Go40%
Updated 3 months ago
Rust
37%
Other

Hook0

Devops

1,484

Open-source Webhooks-as-a-Service: deliver events to your users with auto-retry, signed payloads, and a real-time subscriber dashboard — all without building the infrastructure yourself.

View details
82
Repo Health
82
Technical
69
Dependency
Built with
Rust37%
TypeScript12%
Updated 4 days ago
TypeScript
38%
AGPL 3.0

OpenObserve

Monitoring · Analytics · Devops

21,666

Open source observability platform for logs, metrics, traces, and real user monitoring — delivering 140x lower storage costs than Elasticsearch with a single binary you can run in under 2 minutes.

View details
89
Repo Health
9
Technical
71
Dependency
Built with
TypeScript38%
Rust30%
Vue18%
Updated today
TypeScript
91%
MIT

Super Productivity

Productivity · Project Management

21,845

A privacy-respecting, local-first task manager with built-in timeboxing, Pomodoro timer, and deep integrations for Jira, GitHub, GitLab, and CalDAV — no accounts, no data collection, ever.

View details
90
Repo Health
81
Technical
72
Dependency
Built with
TypeScript91%
Updated 2 days ago
JavaScript
94%
Apache 2.0

swagger-ui

Developer Tools

29,002

Transform OpenAPI specifications into interactive, browser-based API documentation that developers and consumers can explore and test live.

View details
97
Repo Health
83
Technical
65
Dependency
Built with
JavaScript94%
Updated 2 days ago
Go
75%
AGPL 3.0

ZITADEL

Authentication

14,949

Open-source, API-first identity platform delivering multi-tenancy, Passkeys, OIDC, SAML, and SCIM without vendor lock-in.

View details
91
Repo Health
81
Technical
68
Dependency
Built with
Go75%
TypeScript12%
Updated 3 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search