import { Given , Then , When } from "cypress-cucumber-preprocessor/steps" ; let code = "" ; const variableToVerify = "" ; When ( "I use DocString for code like this:" , ( dataString ) => { code = dataString ; } ) ; When ( "I ran it and verify that it executes it" , ( ) => { eval ( code ) ; expect ( variableToVerify ) . to . equal ( "hello world" ) ; } ) ;