Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally skip tests requiring 'yaml' #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/testthat/test_logger_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ test_that("logger_config() works as expected", {


test_that("as_logger_config() works as expected with YAML and JSON files", {
skip_if_not_installed("yaml")
# files work...
cy <- as_logger_config(rprojroot::find_testthat_root_file("testdata", "lg_full.yaml"))
cj <- as_logger_config(rprojroot::find_testthat_root_file("testdata", "lg_full.json"))
Expand All @@ -49,6 +50,7 @@ test_that("as_logger_config() works as expected with YAML and JSON files", {


test_that("as_logger_config() works for simplified yaml logger config", {
skip_if_not_installed("yaml")
cy <- as_logger_config(rprojroot::find_testthat_root_file("testdata", "lg_simple.yaml"))
cj <- as_logger_config(rprojroot::find_testthat_root_file("testdata", "lg_simple.json"))
expect_identical(cj, cy)
Expand Down Expand Up @@ -115,6 +117,7 @@ test_that("resolve_r6_ctors() works as expected", {


test_that("parse_logger_config() works", {
skip_if_not_installed("yaml")
# parse_logger_config turns logger_configs into lists of R6 objects
# that cann direclty be applied to a logger
full <- as_logger_config(rprojroot::find_testthat_root_file("testdata", "lg_full.yaml"))
Expand Down