- Source:
Methods
-
<static> getService(name)
-
getService - Given a childService name returns the childService object.
Parameters:
Name Type Description name
string - Source:
Returns:
childService
- Type
- Object
-
<static> initialize()
-
initialize - Initializes the childService using the serviceControl module
Typically called at the top of cucumber support file that uses the childService using the
cucumber context that containsBefore
,After
,Given
, etc.
Usage:childService.initialize.call(this);
- Source:
Returns:
- Type
- undefined
-
<static> spawn( [spawnArgs])
-
spawn - Launches a Node child process from a shell command via
require('child_process').spawn(...)
The
spawnArgs
parameter allows these options:name: string
The name of the cukelib service (required).cmd: string
Spawn command argument (required).args: [string]
Spawn args argumentoptions: Object
childProcess.spawn options argument (env, cwd, etc.)isReadyMatch: string|RegExp
default:/./
Pattern that is matched from stdout or stderr to indicate the child process is ready.isReady: (proc: childProcess) => Promise
the promise is resolved when the child process is ready. The default is to resolve when data from stdout or stderr matches theisReadyMatch
pattern.stderrHandler: Function(data: string)
default is to print viaconsole.error(chalk.magenta(...))
stdoutHandler: Function(data: string)
default is to print viaconsole.log(chalk.magenta(...))
. Assign the function(data) => null
for a "quiet" output.errorHandler: Function(err: Error)
default is to print the err viaconsole.error(chalk.magenta(...))
Parameters:
Name Type Argument Default Description spawnArgs
Object <optional>
{} see above
- Source:
Returns:
launchService promise
- Type
- Promise