From 4e5c545cf4ce629326a20f39ae7aa34bb28b72a2 Mon Sep 17 00:00:00 2001 From: chefArchitect Date: Thu, 12 Nov 2015 13:55:13 +0200 Subject: [PATCH] Removed callback in World - change in latest Cucumber --- lib/cucumber/World.js | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/lib/cucumber/World.js b/lib/cucumber/World.js index 74b62f2..7f9d9e7 100644 --- a/lib/cucumber/World.js +++ b/lib/cucumber/World.js @@ -2,23 +2,21 @@ * APIs world module */ - + /* + * World Attributes + */ +function World(callback) { + + /* + * World Attributes + */ + this.Api = require('../api/Api'); -module.exports = function World(callback) { - - - this.World = function World(callback) { - - /* - * World Attributes - */ - this.Api = require('../api/Api'); + // done + if (typeof callback === 'function') + callback(); +}; - - - - // tell Cucumber we're finished and to use 'this' as the world instance - callback(); - }; - +module.exports = function() { + this.World = World; };