UNPKG

@serenity-js/core

Version:

The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure

28 lines 1.09 kB
import { ensure, isDefined } from 'tiny-types'; import { BusinessRule, CorrelationId, ScenarioDetails } from '../model/index.js'; import { Timestamp } from '../screenplay/index.js'; import { DomainEvent } from './DomainEvent.js'; /** * Emitted by [@serenity-js/cucumber](https://serenity-js.org/api/cucumber) * when a [business rule](https://cucumber.io/docs/gherkin/reference/#rule) is detected. * * @group Events */ export class BusinessRuleDetected extends DomainEvent { sceneId; details; rule; static fromJSON(o) { return new BusinessRuleDetected(CorrelationId.fromJSON(o.sceneId), ScenarioDetails.fromJSON(o.details), BusinessRule.fromJSON(o.rule), Timestamp.fromJSON(o.timestamp)); } constructor(sceneId, details, rule, timestamp) { super(timestamp); this.sceneId = sceneId; this.details = details; this.rule = rule; ensure('sceneId', sceneId, isDefined()); ensure('details', details, isDefined()); ensure('rule', rule, isDefined()); } } //# sourceMappingURL=BusinessRuleDetected.js.map