If you are creating runners and want to tap into the runner listeners or callbacks, you can do so by creating a class or a struct with the different events we announce.
Event | Description |
---|---|
Every run
and runRaw
methods accepts a callbacks
argument, which can be a Class with the right listener methods or a struct with the right closure methods. This will allow you to listen to the testing progress and get information about it. This way you can build informative reports or progress bars.
onBundleStart
When each bundle begins execution
onBundleEnd
When each bundle ends execution
onSuiteStart
Before a suite (describe, story, scenario, etc)
onSuiteEnd
After a suite
onSpecStart
Before a spec (it, test, then)
onSpecEnd
After a spec