- When checking for RStudio, check if RStudio is actually running, and not just
if rstudioapi is installed. This fixes bugs with non-interactive use of
test_subdir()
and co. - Make
test_subdir()
work with testthat 3 and parallel testing (#18)
use_testdata_raw()
gainsname
argument similar tousethis::use_data()
. Ifname
is provided, a script file for a dataset of that name is created (and opened if you are using RStudio) (#15, thanks @TylerGrantSmith)- removed some brittle tests for compatibility with usethis 1.6.0 (#16, thanks @jennybc)
- don't load helpers twice in
test_this()
(#13, thanks @krlmlr)
- added
find_testdata()
which returns the path to the testdata directory - added
version
andrefhook
argument touse_testdata()
(which are passed on tosaveRDS()
). You can useversion = 2
to create testdata that is compatible with R < 3.5.0. - added
test_index()
which displays an index / table of contents of alltest_that()
calls in a package'stests/testthat
directory. Uses source markers if called from RStudio. - renamed
get_test_coverage()
to justtest_coverage()
- added
.covrignore
support totest_coverage()
read_testdata()
now works in R CMD Check thanks to @JakeVestal (#11)
- Import
parse_ns_file()
from pkgload instead of devtools - #* @testfile tag paths can now contain the script file extension
.R
- removed deprecated
lest_this()
function - various small bug fixes and improvements
- Maintenance release to make vignette comply with new CRAN guidelines
- test (
test_this()
,test_subdir()
, etc..) functions now save all files in RStudio and reload the package before running tests. lest_this()
has been deprecated.test_this()
now behaves likelest_this()
- added
test_all()
to run tests in all subdirectories - Use
usethis::proj_get()
instead of thebase_path
function argument for compatibility with usethis.
- Reorganized package documentation (README, vignette,
?testthis
) - all
pkg =
function arguments have been changed tobase_path =
for consistency with the usethis package. get_test_coverage()
now recognizes tests in test subdirs
- Reworked an expanded infrastructure functions, such as
use_testdata()
anduse_test_subdir()
. See README for details. test_skeleton()
now honors the#* @testfile
tagopen_test()
can now jump back and forth between source and test file, and does no longer automatically create test files.- testthis now depends on the new usethis package that replaces some of the functionality from devtools
- Prevent creation of .rd files for unexported functions with @noRd