Use these functions to create standardized fixture directories for unit tests.
They automatically detect whether code is running inside a test (via testthat::is_testing())
and adjust paths accordingly. This ensures consistent fixture management across
both interactive test development and automated test runs.
Value
Character. Sanitized absolute path to the fixture directory. The directory is created if it doesn't exist.
Details
Both functions create directories if they don't exist and return sanitized paths. The fixture structure follows a convention where:
_mocks/subdirectory stores mock objects, API responses, or stubbed data_extra/subdirectory stores supplementary test data, fixtures, or resources
When testthat::is_testing() returns TRUE (inside test execution), paths are
relative to the test directory. Otherwise, testthat::test_path() is used to
resolve the absolute path, supporting interactive test development.
