Skip to content

Commit

Permalink
use testthat and add test
Browse files Browse the repository at this point in the history
  • Loading branch information
andypicke committed May 4, 2024
1 parent b9aeeb0 commit 3708600
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ Imports:
httr,
jsonlite,
stringr
Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
12 changes: 12 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
# * https://testthat.r-lib.org/articles/special-files.html

library(testthat)
library(emberr)

test_check("emberr")
3 changes: 3 additions & 0 deletions tests/testthat/test-get_api_request.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test_that("bad url throws error", {
expect_error(get_api_request(query_url = "foo"))
})

0 comments on commit 3708600

Please sign in to comment.