import { IHook , ISupportCodeExecutor } from '@cucumber/fake-cucumber' ; import * as messages from '@cucumber/messages' ; import { NilCodeExecutor } from './SupportCodeExecutor' ; export default class PredictableHook implements IHook { constructor ( public readonly id , private readonly scenarioId , private readonly location , public readonly status , public readonly duration , public readonly errorMessage ? ) { } match ( pickle ) { if ( ! pickle . astNodeIds . includes ( this . scenarioId ) ) { return null ; } return new NilCodeExecutor ( null ) ; } toMessage ( ) { const locationChunks = this . location . split ( ':' ) ; return { hook : { id : this . id , sourceReference : { uri : locationChunks [ 0 ] , location : { line : parseInt ( locationChunks [ 1 ] ) , } , } , } , } ; } }