R: Source a file, directory, or all helpers.

source_file {testthat} | R Documentation

## Source a file, directory, or all helpers.

### Description

The expectation is that the files can be sourced in alphabetical order. Helper scripts are R scripts accompanying test scripts but prefixed by `helper`. These scripts are once before the tests are run.

### Usage

    source_file(path, env = test_env(), chdir = TRUE)

    source_dir(path, pattern = "\\.[rR]$", env = test_env(), chdir = TRUE)

    source_test_helpers(path = "tests/testthat", env = test_env())

### Arguments

`path` | Path to tests
`env` | Environment in which to evaluate code.
`chdir` | Change working directory to `dirname(path)`?
`pattern` | Regular expression used to filter files

[Package testthat version 1.0.2 Index]