File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1+ export class CypressCucumberError extends Error { }
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ import { assertAndReturn } from "./assertions";
1414
1515import DataTable from "./data_table" ;
1616
17+ import { CypressCucumberError } from "./error" ;
18+
1719import {
1820 IHookBody ,
1921 IParameterTypeDefinition ,
@@ -25,6 +27,10 @@ interface IStepDefinition<T extends unknown[]> {
2527 implementation : IStepDefinitionBody < T > ;
2628}
2729
30+ export class MissingDefinitionError extends CypressCucumberError { }
31+
32+ export class MultipleDefinitionsError extends CypressCucumberError { }
33+
2834export type HookKeyword = "Before" | "After" ;
2935
3036export interface IHook {
@@ -131,9 +137,11 @@ export class Registry {
131137 ) ;
132138
133139 if ( matchingStepDefinitions . length === 0 ) {
134- throw new Error ( `Step implementation missing for: ${ text } ` ) ;
140+ throw new MissingDefinitionError (
141+ `Step implementation missing for: ${ text } `
142+ ) ;
135143 } else if ( matchingStepDefinitions . length > 1 ) {
136- throw new Error (
144+ throw new MultipleDefinitionsError (
137145 `Multiple matching step definitions for: ${ text } \n` +
138146 matchingStepDefinitions
139147 . map ( ( stepDefinition ) => {
You can’t perform that action at this time.
0 commit comments