UNPKG

@serenity-js/core

Version:

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

30 lines (26 loc) 855 B
import type { JSONObject } from 'tiny-types'; import { ensure, isDefined } from 'tiny-types'; import { CorrelationId, Name } from '../model'; import { Timestamp } from '../screenplay'; import { DomainEvent } from './DomainEvent'; /** * @group Events */ export class TestRunnerDetected extends DomainEvent { public static fromJSON(o: JSONObject): TestRunnerDetected { return new TestRunnerDetected( CorrelationId.fromJSON(o.sceneId as string), Name.fromJSON(o.name as string), Timestamp.fromJSON(o.timestamp as string), ); } constructor( public readonly sceneId: CorrelationId, public readonly name: Name, timestamp?: Timestamp, ) { super(timestamp); ensure('sceneId', sceneId, isDefined()); ensure('name', name, isDefined()); } }