diff --git a/types/cucumber/cucumber-tests.ts b/types/cucumber/cucumber-tests.ts index 753e06f0a3..6ba580b108 100644 --- a/types/cucumber/cucumber-tests.ts +++ b/types/cucumber/cucumber-tests.ts @@ -60,6 +60,13 @@ function StepSampleWithoutDefineSupportCode() { callback(); }); + After((scenarioResult: HookScenarioResult, callback: Callback) => { + if (scenarioResult.result.exception) { + console.error(scenarioResult.result.exception); + } + callback(); + }); + After({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback: Callback) => { console.log("After"); callback(); diff --git a/types/cucumber/index.d.ts b/types/cucumber/index.d.ts index 497db1352b..2d2264223d 100644 --- a/types/cucumber/index.d.ts +++ b/types/cucumber/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cucumber-js 4.0 +// Type definitions for cucumber-js 6.0 // Project: http://github.com/cucumber/cucumber-js // Definitions by: Abraão Alves // Jan Molak @@ -7,6 +7,7 @@ // ErikSchierboom // Peter Morlion // Don Jayamanne +// David Goss // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -97,6 +98,7 @@ export interface SourceLocation { export interface ScenarioResult { duration: number; status: Status; + exception?: Error; } export namespace pickle { @@ -253,8 +255,10 @@ export namespace events { } export interface StepDefinition { - // tslint:disable-next-line ban-types + // tslint:disable:ban-types code: Function; + unwrappedCode?: Function; + // tslint:enable:ban-types line: number; options: {}; pattern: any;