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 {