Start Server and Test Utility

3.0.2 · active · verified Sun Apr 19

start-server-and-test is a command-line utility designed to streamline common development and continuous integration (CI) workflows. It starts a specified server process, robustly waits for a given URL to become available (indicating the server is ready), and then executes a designated test command. Upon completion of the test command, it automatically shuts down the initially started server process, ensuring clean resource management. The current stable version is 3.0.2, released in April 2026. The package maintains an active release cadence, with frequent updates addressing bug fixes and performance, alongside periodic major versions that introduce significant internal improvements, particularly for cross-platform compatibility. Its key differentiators include seamless integration with npm scripts, intelligent process management, and robust service readiness checks, making it an essential tool for automating e2e and integration tests.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to integrate `start-server-and-test` into a `package.json` script to orchestrate starting a server, waiting for it to be ready, and then executing test commands.

{ "scripts": {
    "start-server": "npm start",
    "test": "mocha e2e-spec.js",
    "ci": "start-server-and-test start-server http://localhost:8080 test"
  }
}

view raw JSON →