Skip to content

Commit

Permalink
Add unit test when 't' is not in the columns
Browse files Browse the repository at this point in the history
  • Loading branch information
HediaTnani committed Jan 10, 2024
1 parent cd0fb5d commit ec138a3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/testthat/test-DEqual.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ test_that("DEqual throws an error for non-dataframe input", {
expect_error(DEqual(covComb_tx_deg), "Error: The input to DEqual is not a dataframe.")
})

# Test when 't' is not in the columns
test_that("DE does not have column 't'", {
DE_without_t <- random_de
DE_without_t$t <- NULL
expect_error(DEqual(DE_without_t), "Error: 't' is not a column in DE.")
})

# Test that the output is a ggplot object
test_that("output is a ggplot", {
expect_equal(class(DEqual(random_de))[1], "gg")
Expand Down

0 comments on commit ec138a3

Please sign in to comment.