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
This commit is contained in:
jan-molak
2016-09-06 20:32:21 +01:00
parent 03f3ca4333
commit bd33db1db5
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -4,27 +4,27 @@ function StepSample() {
type Callback = cucumber.CallbackStepDefinition;
var step = <cucumber.StepDefinitions>this;
var hook = <cucumber.Hooks>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) {
+1 -1
View File
@@ -7,7 +7,7 @@ declare namespace cucumber {
export interface CallbackStepDefinition{
pending : () => PromiseLike<any>;
(errror?:any):void;
(errror?:any, pending?: string):void;
}
interface StepDefinitionCode {