load_test_helpers: Load Testthat Helper Files into Environment

View source: R/run_covr_modes.R

load_test_helpersR Documentation

Load Testthat Helper Files into Environment

Description

This function searches for all files in the 'tests/testthat' directory that match the pattern 'helper-*.R' and sources them into the provided environment. This is useful when running coverage with 'covr::environment_coverage()' to ensure helper functions are available during test execution.

Usage

load_test_helpers(env, helper_dir = "tests/testthat")

Arguments

env

An environment into which the helper files should be sourced. Typically this is the same environment used for coverage, e.g., 'cov_env'.

helper_dir

Path to the directory containing helper files. Defaults to '"tests/testthat"'.

Value

Invisibly returns 'TRUE' if all files are sourced successfully.


test.assessr documentation built on March 3, 2026, 1:06 a.m.