UNPKG

@serenity-js/core

Version:

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

25 lines 889 B
import { ensure, isDefined } from 'tiny-types'; import { Artifact, CorrelationId, Name } from '../model/index.js'; import { Timestamp } from '../screenplay/index.js'; import { DomainEvent } from './DomainEvent.js'; /** * @group Events */ export class ArtifactGenerated extends DomainEvent { sceneId; name; artifact; static fromJSON(o) { return new ArtifactGenerated(CorrelationId.fromJSON(o.sceneId), Name.fromJSON(o.name), Artifact.fromJSON(o.artifact), Timestamp.fromJSON(o.timestamp)); } constructor(sceneId, name, artifact, timestamp) { super(timestamp); this.sceneId = sceneId; this.name = name; this.artifact = artifact; ensure('sceneId', sceneId, isDefined()); ensure('name', name, isDefined()); ensure('artifact', artifact, isDefined()); } } //# sourceMappingURL=ArtifactGenerated.js.map