Is there a way to assign a global variable in the beginning of the test? Thus, all testthat could use it. Or would that be against the policy that each testthat creates its own (clean) environment?
Thanks for the information.
You can create these in the "helper" files (R scripts that live in tests/testthat, name starts with "helper-"). These are executed once for each test run.
Cool, works already. Thanks a lot!
There's very little documentation on helpers in the testthat 1.0.2 docs -- are they covered somewhere else perhaps?
It's documented in http://testthat.r-lib.org/reference/test_dir.html#test-files or ?test_dir
, but an introductory vignette would be very helpful.
Most helpful comment
You can create these in the "helper" files (R scripts that live in tests/testthat, name starts with "helper-"). These are executed once for each test run.