Storing as a Static Test Fixture
If a useful_thing
is costly to create, in terms of time or memory. It can be saved in the tests/testthat/fixtures/
folder, but with its corresponding companion R script.
.
├── ...
└── tests
├── testthat
│ ├── fixtures
│ │ ├── make-useful-things.R
│ │ ├── useful_thing1.rds
│ │ └── useful_thing2.rds
│ ├── helper.R
│ ├── setup.R
│ └── (all the test files)
└── testthat.R