import Path from 'path' ; import { Logger } from '../../lib/utils/create_logger' ; import { Scenario } from '../scenario' ; export function getScenario ( { file , logger } ) { const location = Path . join ( process . cwd ( ) , String ( file ) ) ; logger . debug ( `Loading scenario from ${ location }` ) ; return import ( location ) . then ( ( m ) => { if ( m && m . default ) { return m . default ; } throw new Error ( `Could not find scenario at ${ location }` ) ; } ) as Promise < Scenario > ; }