Universal app runner for codeceptJS.
npm install codecept.app-runner
`` sh`
$ yarn add --dev codecept.app-runneror with npm:
$ npm install --save-dev codecept.app-runner
Then invoke startApp method provided by plugin inside bootstrap hook:
` js
const { startApp } = require('codecept.app-runner');
module.exports.config = {
// your usual codecept config
bootstrap: function(done) {
startApp({
host: 'localhost',
port: 8888,
appCommand: "node app.js",
appPath: __dirname
}, done);
}
}
`
method accepts two parameters, first one is config object and
second is done callback which is called in order for Codecept to know when
it's time to run tests.$3
- host - host on which Codecept should wait for application \*
- port - port on which Codecept should wait for application \*
- appCommand - command executed to run application
- appPath - absolute path to directory where application should be run\*
host and port` options are used only to wait for URL to start responding