import { Readable } from 'stream' ; import * as messages from '@cucumber/messages' ; export default function toArray ( input ) { return new Promise ( ( resolve , reject ) => { const result = [ ] ; input . on ( 'data' , ( wrapper ) => result . push ( wrapper ) ) ; input . on ( 'end' , ( ) => resolve ( result ) ) ; input . on ( 'error' , ( err ) => reject ( err ) ) ; } ) ; }