mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
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:
@@ -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) {
|
||||
|
||||
Vendored
+1
-1
@@ -7,7 +7,7 @@ declare namespace cucumber {
|
||||
|
||||
export interface CallbackStepDefinition{
|
||||
pending : () => PromiseLike<any>;
|
||||
(errror?:any):void;
|
||||
(errror?:any, pending?: string):void;
|
||||
}
|
||||
|
||||
interface StepDefinitionCode {
|
||||
|
||||
Reference in New Issue
Block a user