import * as messages from '@cucumber/messages' ; function makeFeature ( name , description , scenarios ) { return { keyword : 'Feature' , language : 'en' , location : { line : 1 } , tags : [ ] , name , description , children : scenarios . map ( ( scenario ) => ( { scenario , } ) ) , } ; } function makeRule ( name , description , scenarios ) { const idGenerator = messages . IdGenerator . uuid ( ) ; return { id : idGenerator ( ) , keyword : 'Rule' , location : { line : 1 } , tags : [ ] , name , description , children : scenarios . map ( ( scenario ) => ( { scenario , } ) ) , } ; } function makeScenario ( name , description , steps ) { const idGenerator = messages . IdGenerator . uuid ( ) ; return { id : idGenerator ( ) , keyword : 'Scenario' , location : { line : 1 } , tags : [ ] , examples : [ ] , name : name , description : description , steps : steps , } ; } function makeStep ( keyword , text , docstring = '' , datatable = [ ] ) { const idGenerator = messages . IdGenerator . uuid ( ) ; const docString = docstring ? { content : docstring , delimiter : '"""' , location : { line : 1 } , } : undefined ; const dataTable = datatable . length > 0 ? { location : { line : 1 } , rows : datatable . map ( ( row ) => ( { location : { line : 1 } , id : '123' , cells : row . map ( ( cell ) => ( { value : cell , location : { line : 1 } , } ) ) , } ) ) , } : undefined ; return { id : idGenerator ( ) , location : { line : 1 } , keyword : keyword , text : text , docString , dataTable , } ; } export { makeFeature , makeScenario , makeStep , makeRule } ;