import assert from 'assert' ; import { Given , ParameterType } from '@cucumber/fake-cucumber' ; class Flight { constructor ( public readonly from , public readonly to ) { } } ParameterType ( { name : 'flight' , regexp : /([A-Z]{3})-([A-Z]{3})/ , transformer ( from , to ) { return new Flight ( from , to ) ; } , } ) ; Given ( '{flight} has been delayed {int} minutes' , function ( flight , delay ) { assert . strictEqual ( flight . from , 'LHR' ) ; assert . strictEqual ( flight . to , 'CDG' ) ; assert . strictEqual ( delay , 45 ) ; } ) ;