You could create the object in "tests/testthat/setup.R". The testthat vignette on special files covers setup files and a few others of possible general interest, such as "helper" files and data files.