vitest icon indicating copy to clipboard operation
vitest copied to clipboard

Support for ctx.todo()

Open flowt-au opened this issue 7 months ago • 2 comments

Clear and concise description of the problem

I am using vitest-cucumber which is great. An upcoming release will support the Vitest ctx.skip() option by passing the ctx into the test (like Vitest does) like this:

Then(`the result of test "<id>" should be <result>`, (ctx) => {
      ctx.skip()
})

I know in Vitest this is possible: test.todo('unimplemented test') but that can't be done in vitest-cucumber.

Suggested solution

I would love the option of ctx.todo(myMessage) so I can write all the Gherkin, set the tests to have ctx.todo() then have them work like the test.todo('unimplemented test') does, with the addition of an optional custom message.

Then(`the result of test "<id>" should be <result>`, (ctx) => {
      ctx.todo('Waiting for the client to ok this idea')
})

I think this would be of use to non-BDD testers too.

Alternative

No response

Additional context

Anyway, thanks for a great library! Murray

Validations

flowt-au avatar Jul 24 '24 06:07 flowt-au