acuminous/yadda

Report unused step definitions

Closed this issue · 4 comments

Is there a way of getting Yadda to report step definitions that have been loaded but have not been used by any feature scenarios?

Thanks

There's nothing built in to Yadda for this and I agree it would be a nice feature, however I'm not sure it's feasible. One of the benefits of yadda is that you can selectively load libraries and choose which features to execute, so not all steps will be be executed for every test run.

I understand. I wonder if it's possible to support this by adding a means to query Yadda for steps run, and for steps loaded - and leave it up to the user to decide what to do with that information.

I was thinking along the same lines. You can already get the steps run by listening to the ON_STEP or ON_EXECUTE event. It should be easy to add an ON_STEP_LOAD event emitted in the same way

Available in 0.17.8. I added an example showing how it can be used