diff --git a/types/cucumber/cucumber-tests.ts b/types/cucumber/cucumber-tests.ts index 77760bd5ac..c71e827285 100644 --- a/types/cucumber/cucumber-tests.ts +++ b/types/cucumber/cucumber-tests.ts @@ -13,7 +13,7 @@ function StepSample() { type Table = cucumber.TableDefinition; type HookScenarioResult = cucumber.HookScenarioResult; - cucumber.defineSupportCode(({setWorldConstructor, defineParameterType, After, Around, Before, registerHandler, Given, When, Then}) => { + cucumber.defineSupportCode(({setWorldConstructor, defineParameterType, After, AfterAll, Around, Before, BeforeAll, registerHandler, Given, When, Then}) => { setWorldConstructor(function({attach, parameters}) { this.attach = attach; this.parameters = parameters; @@ -32,6 +32,16 @@ function StepSample() { callback(); }); + BeforeAll((callback: Callback) => { + console.log("Before all"); + callback(); + }); + + BeforeAll({ timeout: 1000 }, (callback: Callback) => { + console.log("Before all"); + callback(); + }); + Around((scenarioResult: HookScenarioResult, runScenario: (error: string | null, callback?: () => void) => void) => { if (scenarioResult.status === "failed") { runScenario(null, () => { @@ -50,6 +60,16 @@ function StepSample() { callback(); }); + AfterAll((callback: Callback) => { + console.log("After all"); + callback(); + }); + + AfterAll({ timeout: 1000 }, (callback: Callback) => { + console.log("After all"); + callback(); + }); + registerHandler('AfterFeatures', (event: any, callback: () => void) => { callback(); });