mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
cucumber: add missing props to ScenarioResult and StepDefinition (#40102)
* add optional `exception` to HookScenarioResult * add optional unwrappedCode prop to StepDefinition * update cucumber-js version in header
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
8f92920eb8
commit
0b54fd9eee
@@ -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();
|
||||
|
||||
8
types/cucumber/index.d.ts
vendored
8
types/cucumber/index.d.ts
vendored
@@ -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 <https://github.com/abraaoalves>
|
||||
// Jan Molak <https://github.com/jan-molak>
|
||||
@@ -7,6 +7,7 @@
|
||||
// ErikSchierboom <https://github.com/ErikSchierboom>
|
||||
// Peter Morlion <https://github.com/petermorlion>
|
||||
// Don Jayamanne <https://github.com/DonJayamanne>
|
||||
// David Goss <https://github.com/davidjgoss>
|
||||
// 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;
|
||||
|
||||
Reference in New Issue
Block a user