Check that the tests don't change the global state #388
Labels
Beginner-friendly 🤝
Friendly for new contributors
Code Style 👩💻
Core Packages 📦
Discussion and planning about core packages of easystats
Low priority 😴
This issue does not impact package functionality much
Tests shouldn't change the R landscape, and testthat can't always do this clean-up for you. So we can check ourselves that we are writing self-contained tests.
To make sure that the tests aren't changing the global state, add the following to
tests/testthat/helper-state.R
:If a test is changing the global state, it will produce warnings and the
check-test-warnings
workflow will fail.To know more about how
set_state_inspector()
works, read the package docs.Progress tracker:
The text was updated successfully, but these errors were encountered: