Я обновляю версию cucumberJS (1.3.3 до 5.1.0). Теперь проблема в том, что код, который использовался для программного вызова cucumber cli в index.js, больше не работает. />
node ./index.js -s ./step_definitions
файл index.js:
cucumberCli.run(function(succeeded) {
var code = succeeded ? 0 : 1;
function exitNow() {
process.exit(code);
}
if (process.stdout.write("")) {
exitNow();
} else {
// write() returned false, kernel buffer is not empty yet...
process.stdout.on("drain", exitNow);
}
});
Я получаю ошибку ниже
cucumberCli = cucumber.Cli(process.argv);
^
TypeError: Class constructor Cli cannot be invoked without 'new'
at Object.<anonymous> (E:\newFrame - Copy\index.js:182:24)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! newframe@1.0.0 test: `node ./index.js -s ./step_definitions -x 50000`
npm ERR! Exit status 1
Я пробовал с новым ключевым словом и всеми возможными способами преодолеть эту проблему, но безуспешно.