test_coverage: Test coverage of package

Description Usage Arguments Details Value Examples

View source: R/test_coverage.R

Description

This determines the test coverage of the target package based on the desc argument of test_that() calls. If you require a more comprehensive analysis of test coverage, try the package covr instead.

Usage

1
test_coverage(from_tags = TRUE, from_desc = TRUE)

Arguments

from_tags

logical scalar. Checks the files if your test directory for testthis tags. Specifically, if you have the comment #* @testing myfunction in any of your test files, myfunction will be marked as tested.

from_desc

logical scalar. Checks the desc argument test_that(...) of the tests in your test directory for functions names. E.g. if you have a test file that contains test_that("myfunction works", {...}), myfunction will be marked as tested.

Details

test_coverage looks in .covrignore for functions that should be ignored for coverage analysis (see usethis::use_covr_ignore())

Value

A Test_coverage object. This is a data.frame containing the following columns:

Examples

1
2
3
4
5
## Not run: 
x <- test_coverage()
as.data.frame(x)

## End(Not run)

testthis documentation built on April 14, 2020, 6:23 p.m.