inst/tinytest/test_checkInstalled.R

expect_error(
    checkInstalled("abc123xyzjfk"),
    "To use this function, install missing package dependencies."
)

tinytest::expect_match(
    trimws(
        capture.output(
            tryCatch({
                checkInstalled("abc123xyzjfk")
            }, error = function(e) {
                invisible()
            })
        )[3]
    ),
    "BiocManager::install\\(\\\"abc123xyzjfk\\\"\\)"
)

expect_true(
    checkInstalled(c("base", "datasets"))
)
Bioconductor/BiocDeveloper documentation built on Oct. 31, 2024, 5:50 a.m.