mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-09-28 20:07:04 +00:00
Adds a bit of tests for new cucumber hooks
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user