Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
eventBroadcaster.on('test-step-finished', ({ index, result, testCase }) => {
ensure('test-step-finished :: index', index, isDefined());
ensure('test-step-finished :: result', result, isDefined());
ensure('test-step-finished :: testCase', testCase, isDefined());
const
map = cache.get(new Path(testCase.sourceLocation.uri)),
scenario = map.get(Scenario).onLine(testCase.sourceLocation.line),
step = scenario.steps[index];
if (step instanceof Step) { // ignore hooks
notifier.stepFinished(step, this.outcomeFrom(result));
}
});
constructor(public readonly value: string) {
super();
ensure(this.constructor.name, value, isDefined());
}
eventBroadcaster.on('test-case-finished', ({ result, sourceLocation }) => {
ensure('test-case-finished :: result', result, isDefined());
ensure('test-case-finished :: sourceLocation', sourceLocation, isDefined());
const
map = cache.get(new Path(sourceLocation.uri)),
scenario = map.get(Scenario).onLine(sourceLocation.line),
nonHookSteps = scenario.steps.filter(step => step instanceof Step);
const outcome: Outcome = nonHookSteps.length > 0
? this.outcomeFrom(result)
: new ImplementationPending(new ImplementationPendingError(`"${ scenario.name.value }" has no test steps`));
notifier.scenarioFinished(scenario, map.getFirst(Feature), outcome);
});
}
constructor(public readonly value: string) {
super();
ensure(this.constructor.name, value, isDefined());
}
}
constructor(
private dressingRoom: DressingRoom,
private readonly manager: StageManager,
) {
ensure('DressingRoom', dressingRoom, isDefined());
ensure('StageManager', manager, isDefined());
}
constructor(
public readonly description: Description,
) {
super();
ensure('description', description, isDefined());
}
}