import { Given , After , Before , ParameterType } from '../src/dsl' ; import assert from 'assert' ; Before ( '@before-passed' , ( ) => { } ) ; Before ( '@before-failed' , ( ) => { throw new Error ( 'Something went wrong in before hook' ) ; } ) ; After ( '@after-passed' , ( ) => { } ) ; After ( '@after-failed' , ( ) => { throw new Error ( 'Something went wrong in after hook' ) ; } ) ; Given ( 'a passed step' , ( ) => { } ) ; Given ( 'I have {int} cukes' , ( cukes ) => { assert . notStrictEqual ( cukes , undefined ) ; } ) ; class Flight { constructor ( public readonly name ) { } } ParameterType ( { name : 'flight' , regexp : /[A-Z]{3}-[A-Z]{3}/ , transformer ( name ) { return new Flight ( name ) ; } , } ) ; Given ( 'flight {flight}' , ( flight ) => { assert . strictEqual ( flight . name , 'LHR-CDG' ) ; } ) ;