0.3.4 • Published 1 month ago

waitnrun v0.3.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

waitnrun

wait-and-run

Starts server, waits for URL, then run your tests.

This package is developed because I could not resolve npm audit issues of "start-and-server" package, especially wait-on and axios package.

It's a simplified version of start-server-and-test. It has zero dependency. Therefore, you will see 0(zero) security vulnerability.

The package size is 2.3KB(0 npm module dependency), compared to start-server-and-test's 11KB(plus 107 npm module dependencies).

Install

Requires Node version 16 or above.

npm install waitnrun -D

Usage

const procs = await waitnrun(['http-server', ':8080', 'ng serve', ':3000', 'cypress run']);
procs.forEach(proc => proc?.kill?.());

CLI

# run http-server, then when port 8000 responds run Cypress tests
waitnrun 'npx http-server' 8080 'cypress run'
waitnrun 'npx http-server' :8080/index.html 'cypress run'
waitnrun 'npx http-server' http://localhost:8080/index.html 'cypress run'
waitnrun start-server :4300/api/health 'ng serve' 'cypress run'
0.3.4

1 month ago

0.3.3

5 months ago

0.3.2

6 months ago

0.3.1

6 months ago

0.3.0

6 months ago

0.2.4

6 months ago

0.2.3

6 months ago

0.2.2

6 months ago

0.2.1

6 months ago

0.2.0

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago