Skip to content

Commit

Permalink
feat: Adding codecov_fun argument coherence checking in inflate()
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohann Mansiaux committed Jun 12, 2024
1 parent d97b4a6 commit dfb2add
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion R/inflate.R
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,15 @@ inflate <- function(pkg = ".", flat_file,
)

if (codecov) {
if (!codecov_fun %in% c("package_coverage", "report")) {
codecov_fun <- try(
match.arg(
codecov_fun,
c("package_coverage", "report"),
several.ok = FALSE
),
silent = TRUE
)
if (inherits(codecov_fun, "try-error")) {
cli::cli_abort("codecov_fun must be either 'package_coverage' or 'report'")
}

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-inflate-part3.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ usethis::with_project(dummypackage, {
open = FALSE,
overwrite = TRUE
)

capture.output(
inflate(
pkg = dummypackage,
Expand Down

0 comments on commit dfb2add

Please sign in to comment.