tests/testthat/test-infer_biocviews.R

test_that("infer_biocviews works", { 
  
  # Don't run simply bc biocViews::recommendBiocViews is unable
  ## to find the DESCRIPTION file when running examples.
  # biocviews1 <- infer_biocviews(pkgdir = "../../")
  # testthat::expect_equal(biocviews1,"Software")
  
  if(testthat::is_testing() &&
     !is_gha()){
    message("Skipping test.")
  } else {
    testthat::expect_equal(infer_biocviews(include_branch = FALSE),
                           c("Software","WorkflowManagement"))  
  }
  biocviews_manual = c("Software","Genetics","Transcriptomics") 
  if(testthat::is_testing() && 
     !is_gha()){
    message("Skipping test.")
  } else {
    testthat::expect_equal(infer_biocviews(biocviews = biocviews_manual),
                           c(biocviews_manual,"WorkflowManagement"))
  }

  #### Errors ####
  testthat::expect_error(
    infer_biocviews(branch = "typo")
  )
  testthat::expect_error(
    infer_biocviews(type = "typo")
  ) 
})

Try the rworkflows package in your browser

Any scripts or data that you put into this service are public.

rworkflows documentation built on May 29, 2024, 2:37 a.m.