Gathering detailed insights and metrics for start-server-and-test-with-options
Gathering detailed insights and metrics for start-server-and-test-with-options
Gathering detailed insights and metrics for start-server-and-test-with-options
Gathering detailed insights and metrics for start-server-and-test-with-options
Starts server, waits for URL, then runs test command; when the tests end, shuts down server
npm install start-server-and-test-with-options
Typescript
Module System
Min. Node Version
Node Version
NPM Version
56.8
Supply Chain
85.6
Quality
68.4
Maintenance
50
Vulnerability
97
License
JavaScript (100%)
Total Downloads
583
Last Day
1
Last Week
5
Last Month
9
Last Year
68
MIT License
1,554 Stars
253 Commits
96 Forks
10 Watchers
19 Branches
22 Contributors
Updated on May 02, 2025
Minified
Minified + Gzipped
Latest Version
0.0.1
Package Id
start-server-and-test-with-options@0.0.1
Unpacked Size
14.19 kB
Size
5.07 kB
File Count
5
NPM Version
6.4.1
Node Version
10.9.0
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
150%
5
Compared to previous week
Last Month
-18.2%
9
Compared to previous month
Last Year
17.2%
68
Compared to previous year
Starts server, waits for URL, then runs test command; when the tests end, shuts down server
Requires Node version 6 or above.
1npm install --save-dev start-server-and-test
This command is meant to be used with NPM script commands. If you have a "start server", and "test" script names for example, you can start the server, wait for a url to respond, then run tests. When the test process exits, the server is shut down.
1{ 2 "scripts": { 3 "start-server": "npm start", 4 "test": "mocha e2e-spec.js", 5 "ci": "start-server-and-test start-server http://localhost:8080 test" 6 } 7}
To execute all tests simply run npm run ci
You can use either start-server-and-test
, server-test
or start-test
commands in your scripts.
You can use :
in front of port number like server-test :8080
, so all these are equivalent
start-server-and-test start http://localhost:8080 test
server-test start http://localhost:8080 test
server-test http://localhost:8080 test
start-test :8080 test
start-test 8080 test
start-test 8080
If you use convention and name your scripts "start" and "test" you can simply provide URL
1{ 2 "scripts": { 3 "start": "npm start", 4 "test": "mocha e2e-spec.js", 5 "ci": "start-server-and-test http://localhost:8080" 6 } 7}
You can also shorten local url to just port, the code below is equivalent to checking http://localhost:8080
.
1{ 2 "scripts": { 3 "start": "npm start", 4 "test": "mocha e2e-spec.js", 5 "ci": "server-test 8080" 6 } 7}
You can provide first start command, port (or url) and implicit test
command
1{ 2 "scripts": { 3 "start-it": "npm start", 4 "test": "mocha e2e-spec.js", 5 "ci": "server-test start-it 8080" 6 } 7}
You can provide port number and custom test command, in that case npm start
is assumed to start the server.
1{ 2 "scripts": { 3 "start": "npm start", 4 "test-it": "mocha e2e-spec.js", 5 "ci": "server-test :9000 test-it" 6 } 7}
You can provide multiple resources to wait on, separated by a pipe |
. (be sure to wrap in quotes)
1{ 2 "scripts": { 3 "start": "npm start", 4 "test-it": "mocha e2e-spec.js", 5 "ci": "server-test \"8080|http://foo.com\"" 6 } 7}
If you are using webpack-dev-server (directly or via angular/cli
or other boilerplates) then please use the following URL form to check
start-server-and-test http-get://localhost:8080
This is because under the hood this module uses wait-on to ping the server. Wait-on uses HEAD
by default, but webpack-dev-server
does not respond to HEAD
only to GET
requests. Thus you need to use http-get://
URL format to force wait-on
to use GET
probe.
You can even wait on the bundle JavaScript url instead of the page url, see discussion in this issue #4
To see diagnostic messages, run with environment variable DEBUG=start-server-and-test
To see disable HTTPS checks for wait-on
, run with environment variable START_SERVER_AND_TEST_INSECURE=1
.
Author: Gleb Bahmutov <gleb.bahmutov@gmail.com> © 2017
License: MIT - do anything with the code, but don't blame me if it does not work.
Support: if you find any problems with this module, email / tweet / open issue on Github
Copyright (c) 2017 Gleb Bahmutov <gleb.bahmutov@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/27 approved changesets -- score normalized to 1
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
107 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More