Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const runtime = new Cucumber.Runtime({
eventBroadcaster,
options: this.cucumberOpts,
supportCodeLibrary,
testCases
});
const beforeHookRetval = await executeHooksWithArgs(this.config.before, [this.capabilities, this.specs]);
// if beforeHookRetval contains some value, then this is an error thrown by 'before' method
if (beforeHookRetval && Array.isArray(beforeHookRetval) && beforeHookRetval.length > 0 && beforeHookRetval[0]) {
throw beforeHookRetval[0];
}
const result = await runtime.start() ? 0 : 1;
const afterHookRetval = await executeHooksWithArgs(this.config.after, [result, this.capabilities, this.specs]);
// if afterHookRetval contains some value, then this is an error thrown by 'after' method
if (afterHookRetval && Array.isArray(afterHookRetval) && afterHookRetval.length > 0 && afterHookRetval[0]) {
throw afterHookRetval[0];
}
await this.disposeOxygenCore();
this.reporter.onRunnerEnd(this.id, null);
return result;
}
catch (e) {
console.log('Fatal error in Cucumber runner:', e);
this.reporter.onRunnerEnd(this.id, e);
}
}
});
const testCases = await Cucumber.getTestCasesFromFilesystem({
cwd: this.cwd,
eventBroadcaster,
featurePaths: this.specs.map(spec => spec.replace(/(:\d+)*$/g, '')),
order: this.cucumberOpts.order,
pickleFilter
});
const runtime = new Cucumber.Runtime({
eventBroadcaster,
options: this.cucumberOpts,
supportCodeLibrary,
testCases
});
const beforeHookRetval = await executeHooksWithArgs(this.config.before, [this.capabilities, this.specs]);
// if beforeHookRetval contains some value, then this is an error thrown by 'before' method
if (beforeHookRetval && Array.isArray(beforeHookRetval) && beforeHookRetval.length > 0 && beforeHookRetval[0]) {
throw beforeHookRetval[0];
}
const result = await runtime.start() ? 0 : 1;
const afterHookRetval = await executeHooksWithArgs(this.config.after, [result, this.capabilities, this.specs]);
// if afterHookRetval contains some value, then this is an error thrown by 'after' method
if (afterHookRetval && Array.isArray(afterHookRetval) && afterHookRetval.length > 0 && afterHookRetval[0]) {
throw afterHookRetval[0];
}
await this.disposeOxygenCore();
this.reporter.onRunnerEnd(this.id, null);