class ShellTester
API for the shell-tester
library. Create a ShellTester
instance to test your shell setup.
Constructors
Methods
run(argv)
Runs the registered sessions.
Name | Type | Description |
---|---|---|
|
|
The command line arguments. If no argument is passed, it will run all the registered sessions. If an argument is passed, it will run only the session with the matching name. |
Returns |
|
Signature
run(argv?: string[]): Promise<void>;
session(name, callback)
Register a new session to be tested. The session will not be run until run()
is called.
Name | Type | Description |
---|---|---|
|
|
The session name. This can be used to filter the session to be run from the command line. |
|
|
An async function that automates this shell session. The function will be called with a ShellSession instance. |
Returns |
|
Signature
session(name: string, callback: (session: ShellSession) => Promise<void>): void;