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.
npm install start-server-and-testVerified import paths — ran on the pinned version, not inferred.
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.
Upgrade to v3.0.0 or newer. No specific user action is typically required, as this change improves internal behavior.
Ensure your Node.js environment is version 20 or higher. The package's `engines` field now explicitly reflects a requirement of `^22 || >=24`.
Update your scripts to use the full URL, like `http://localhost:xxxx` instead of just `xxxx`.
Always use a full, explicit URL like `http://127.0.0.1:port` or `http://0.0.0.0:port` to ensure reliable server readiness checks.
Verify that your server start command is correct and the server is indeed listening on the specified URL. Increase the `wait-on` timeout if the server takes longer to warm up (e.g., `start-server-and-test <server> <url> --wait-on-timeout 60000 <test>`).
Ensure the package is installed (`npm install --save-dev start-server-and-test`). If running from the command line, use `npx start-server-and-test ...`. When used in `package.json` scripts, `npm` automatically adds `./node_modules/.bin` to the PATH, so `start-server-and-test ...` should work directly.
Upgrade to `start-server-and-test` version 3.0.0 or newer. This version explicitly removes the dependency on `wmic.exe` and uses a more robust, platform-agnostic method for process termination on Windows.
No dependency data recorded yet.