ReadyCmd
Class for ready check commands.Constructors
Parameters
| Parameter | Type |
|---|---|
cmd | string |
Returns
ReadyCmd
Methods
getCmd()
Returns
string
Functions
waitForFile()
Parameters
| Parameter | Type | Description |
|---|---|---|
filename | string | Path to the file to wait for |
Returns
ReadyCmd
ReadyCmd that checks for the file
Example
waitForPort()
ss command to check if a port is open and listening.
Parameters
| Parameter | Type | Description |
|---|---|---|
port | number | Port number to wait for |
Returns
ReadyCmd
ReadyCmd that checks for the port
Example
waitForProcess()
pgrep to check if a process exists.
Parameters
| Parameter | Type | Description |
|---|---|---|
processName | string | Name of the process to wait for |
Returns
ReadyCmd
ReadyCmd that checks for the process
Example
waitForTimeout()
sleep command to wait for a fixed duration.
Parameters
| Parameter | Type | Description |
|---|---|---|
timeout | number | Time to wait in milliseconds (minimum: 1000ms / 1 second) |
Returns
ReadyCmd
ReadyCmd that waits for the specified duration
Example
waitForURL()
curl to make HTTP requests and check the response status.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
url | string | undefined | URL to check (e.g., ‘http://localhost:3000/health’) |
statusCode | number | 200 | Expected HTTP status code (default: 200) |
Returns
ReadyCmd
ReadyCmd that checks the URL