import * as messages from '@cucumber/messages' ; import { IWorld } from '../src' ; export default class TestWorld implements IWorld { public testStepId : string ; public readonly attachments : messages . Attachment [ ] = [ ] ; public attach ( data , mediaType ) { if ( typeof data !== 'string' ) { throw new Error ( 'Can only attach strings' ) ; } const attachment = { body : data , mediaType : 'text/plain' , contentEncoding : messages . AttachmentContentEncoding . IDENTITY , } ; this . attachments . push ( attachment ) ; } public log ( text ) { this . attach ( text , 'text/x.cucumber.log+plain' ) ; } }