From bd33db1db56619530151db2511528740110b899d Mon Sep 17 00:00:00 2001 From: jan-molak Date: Tue, 6 Sep 2016 20:32:21 +0100 Subject: [PATCH] Amended the signature of the callback function so that it's up to date with the latest version of cucumber-js. https://github.com/cucumber/cucumber-js#step-definitions --- cucumber/cucumber-tests.ts | 10 +++++----- cucumber/cucumber.d.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cucumber/cucumber-tests.ts b/cucumber/cucumber-tests.ts index d6ada278c2..816f0e7c70 100644 --- a/cucumber/cucumber-tests.ts +++ b/cucumber/cucumber-tests.ts @@ -4,27 +4,27 @@ function StepSample() { type Callback = cucumber.CallbackStepDefinition; var step = this; var hook = this; - + hook.Before(function(scenario, callback){ scenario.isFailed() && callback.pending(); }) - + hook.Around(function(scenario, runScenario) { scenario.isFailed() && runScenario(null, function(){ console.log('finish tasks'); }); }); - + hook.registerHandler('AfterFeatures', function (event, callback) { callback(); }); - + step.Given(/^I am on the Cucumber.js GitHub repository$/, function(callback:Callback) { this.visit('https://github.com/cucumber/cucumber-js', callback); }); step.When(/^I go to the README file$/, function(title:string, callback:Callback) { - callback.pending(); + callback(null, 'pending'); }); step.Then(/^I should see "(.*)" as the page title$/, { timeout:60*1000}, function(title:string, callback:Callback) { diff --git a/cucumber/cucumber.d.ts b/cucumber/cucumber.d.ts index 6c4273e4e0..dc5c44ef33 100644 --- a/cucumber/cucumber.d.ts +++ b/cucumber/cucumber.d.ts @@ -7,7 +7,7 @@ declare namespace cucumber { export interface CallbackStepDefinition{ pending : () => PromiseLike; - (errror?:any):void; + (errror?:any, pending?: string):void; } interface StepDefinitionCode {