Skip to content
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

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 this issue Feb 25, 2024 · 1 comment

Comments

@zeertzjq
Copy link

Currently, a --helper script can achieve

  • a global before_each after all before_each blocks using busted.subscribe({'test', 'start'}, ...)
  • a global after_each before all after_each blocks using busted.subscribe({'test', 'end'}, ...).

However, it cannot achieve

  • a global before_each before all before_each blocks
  • a global after_each after all after_each blocks

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant