You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varassert=require('assert');vardefineSteps=function(){// `this` is set to an object supplying Given, When, Then and the World constructor.this.World=functionWorld(){this.cukes=0;};// this is optional, would default to// an empty constructor; kinda similar to// cucumber-ruby's Object instancethis.World.prototype.cukeUp=function(){this.cukes++;};this.When(/^I cuke up$/,function(callback){// `this` is set to the World objectthis.cukeUp();callback();});this.Then(/^I should have (\d+) cukes in my belly$/,function(expectedCukes,callback){// `this` is set to the World objectassert.equal(this.cukes,expectedCukes);callback();});};module.exports=defineSteps;
Comments and suggestions are welcome!
The text was updated successfully, but these errors were encountered:
See https://github.com/cucumber/cucumber/wiki/A-Whole-New-World and #2 (comment)
Comments and suggestions are welcome!
The text was updated successfully, but these errors were encountered: