import { AutoRunner , TapReporter } from 'typespec-bdd' ; import './Steps/CalculatorSteps' ; import readline = require ( 'readline' ) ; import * as fs from 'fs' ; AutoRunner . testReporter = new TapReporter ( ) ; function getSpecifications ( ) { return new Promise ( ( resolve , reject ) => { fs . readdir ( './Specifications' , function ( err , items ) { const specifications = [ ] ; for ( const item of items ) { specifications . push ( '/Specifications/' + item ) ; } resolve ( specifications ) ; } ) ; } ) ; } getSpecifications ( ) . then ( ( specs ) => { AutoRunner . run . apply ( AutoRunner , specs ) . then ( ( ) => { const rl = readline . createInterface ( { input : process . stdin , output : process . stdout } ) ; rl . question ( 'Press any key to exit...' , ( answer ) => { rl . close ( ) ; } ) ; } ) ; } ) ;