-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot skip a scenario anymore in v7 #1529
Comments
I just came across the exact same issue while adding support for Cucumber v7 to Serenity/JS. It seems to me that it's a problem with type definitions rather than the actual functionality, which works the exact same way as it used to in v6. @charlierudolph / @davidjgoss, would you mind checking if my thinking below is correct? In export type TestCaseHookFunctionWithoutParameter = () => void | Promise<void>
export type TestCaseHookFunctionWithParameter = (
arg: ITestCaseHookParameter
) => void | Promise<void> Since Cucumber allows for the hook to return export type TestCaseHookFunctionResult = 'skipped' | 'pending' | void
export type TestCaseHookFunctionWithoutParameter = () => TestCaseHookFunctionResult | Promise<TestCaseHookFunctionResult>
export type TestCaseHookFunctionWithParameter = (
arg: ITestCaseHookParameter
) => TestCaseHookFunctionResult | Promise<TestCaseHookFunctionResult> Until this or similar change is introduced, a workaround for this issue would be specifying the test hook as follows: import { Before } from '@cucumber/cucumber';
Before({ tags: '@ignore' }, function () {
return 'skipped' as any;
}); |
Hi @jan-molak , thank you very much for your feedback, your workaround works perfectly ! |
Thanks for the workaround @jan-molak - I'll take a look at this one shortly. |
In V6, to skip a scenario, I used a Before each scenario hook
This same code does not compile anymore in v7 with typescript:
What is the right way to skip a scenario in v7?
Thanks
The text was updated successfully, but these errors were encountered: