Skip to content

Commit

Permalink
shiny_emissions testthat update
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyclements committed May 1, 2024
1 parent 9aa57ef commit b0cdf32
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/testthat/test-shiny_emissions.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
context("testing shiny emissions app")

# Expand on unit testing for shiny app
# Helper function to check if the returned value is a Shiny app
is_shiny_app <- function(x) {
inherits(x, "shiny.appobj")
}

test_that("returned object is shiny.appobj", {
expect_equal(class(shiny_emissions()), c("shiny.appobj"))
# Test to ensure that shiny_emissions function executes and returns a Shiny app
test_that("shiny_emissions launches a Shiny app", {
# Call the shiny_emissions function
app <- shiny_emissions()

# Check if the output is a Shiny app object
expect_true(is_shiny_app(app))
})

0 comments on commit b0cdf32

Please sign in to comment.