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 (24 loc) 896 B
import type { JSONObject} from 'tiny-types'; import { ensure, isDefined, TinyType } from 'tiny-types'; import { FileSystemLocation } from '../io'; import { Category } from './Category'; import { Name } from './Name'; export class ScenarioDetails extends TinyType { static fromJSON(o: JSONObject): ScenarioDetails { return new ScenarioDetails( Name.fromJSON(o.name as string), Category.fromJSON(o.category as string), FileSystemLocation.fromJSON(o.location as JSONObject), ); } constructor( public readonly name: Name, public readonly category: Category, public readonly location: FileSystemLocation, ) { super(); ensure('scenario name', name, isDefined()); ensure('scenario category', category, isDefined()); ensure('scenario location', location, isDefined()); } }