Launches shell executable servers as child processes of the cucumber process.
const { childService } = require('cukelib');
... or standalone ...
const childService = require('cukelib/lib/child_service');
-
config
is an object that represents arguments torequire('child_process').spawn
. It's members arename: string
The name of the cukelib service (required).cmd: string
Spawn command argument (required).args: [string]
Spawn args argumentoptions: Object
Spawn options argument (env, cwd, etc.)isReadyMatch: string|RegExp
Pattern that is matched from stdout or stderr to indicate the child process is ready. Default/./
isReady: (proc: childProcess) => Promise
the promise is resolved when the child process is ready. The defaultisReady
resolves 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(...))
- Sets up event listeners to kill the child process when the parent process exits.
- Returns a promise for a
cukelib
service object:
{ proc: <childProcess>, stop: <stop Function>, config: <merged config object> }
Convenience method that wraps
serviceControl.initialize()
Returns the service object created by
childService.launch