|
6 | 6 | #' are available in the test `env` (e.g. via `load_package`). |
7 | 7 | #' |
8 | 8 | #' @section Special files: |
9 | | -#' There are two types of `.R` file that have special behaviour: |
| 9 | +#' Certain `.R` files have special significance in testthat: |
10 | 10 | #' |
11 | 11 | #' * Test files start with `test` and are executed in alphabetical order. |
12 | 12 | #' |
|
15 | 15 | #' `withr::defer(clean_up(), teardown_env())`. See `vignette("test-fixtures")` |
16 | 16 | #' for more details. |
17 | 17 | #' |
18 | | -#' There are two other types of special file that we no longer recommend using: |
19 | | -#' |
20 | 18 | #' * Helper files start with `helper` and are executed before tests are |
21 | | -#' run. They're also loaded by `devtools::load_all()`, so there's no |
22 | | -#' real point to them and you should just put your helper code in `R/`. |
| 19 | +#' run and, unlike setup files, are also loaded by `devtools::load_all()`. |
| 20 | +#' Helper files can be necessary for side-effect-y code that you need to run |
| 21 | +#' when developing the package interactively. It's certainly possible to |
| 22 | +#' define custom test utilities in a helper file, but they can usually be |
| 23 | +#' defined below `R/`, just like any other internal function. |
| 24 | +#' |
| 25 | +#' There is another type of special file that we no longer recommend using: |
23 | 26 | #' |
24 | 27 | #' * Teardown files start with `teardown` and are executed after the tests |
25 | | -#' are run. Now we recommend interleave setup and cleanup code in `setup-` |
| 28 | +#' are run. Now we recommend interleaving setup and cleanup code in `setup-` |
26 | 29 | #' files, making it easier to check that you automatically clean up every |
27 | 30 | #' mess that you make. |
28 | 31 | #' |
|
0 commit comments