lunarmodules / busted

Elegant Lua unit testing.
https://lunarmodules.github.io/busted/
MIT License
1.38k stars 184 forks source link

Make it easier to run a global before_each before all before_each blocks or a global after_each after all after_each blocks #737

Open zeertzjq opened 4 months ago

zeertzjq commented 4 months ago

Currently, a --helper script can achieve

However, it cannot achieve

To achieve those, one has to call some common code in every test file. If there is some event that a --helper script can subscribe to published before all before_each blocks are run and after all after_each blocks are run, this will be much easier.

zeertzjq commented 4 months ago

This also allows included the time spent in before_each and after_each functions in output, which may be more accurate in some use cases.