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

Establish first unit tests #9

Open
3 tasks
DavidBard opened this issue Mar 7, 2017 · 0 comments
Open
3 tasks

Establish first unit tests #9

DavidBard opened this issue Mar 7, 2017 · 0 comments
Assignees

Comments

@DavidBard
Copy link
Owner

DavidBard commented Mar 7, 2017

For automated testing on Travis (#2) and AppVeyor (#3). Adapt from https://github.com/OuhscBbmc/referral-exposure/tree/master/tests.

  • Create ./tests/test-all.R. Make sure there's an empty last line (not even a space or tab).
#Modeled after the R6 testing structure: https://github.com/wch/R6/blob/master/tests/testthat.R
library(testthat)
library(ReferralExposure)

testthat::test_check("ReferralExposure")
  • Create .tests/testhat/rest-basic.R. Make sure there's an empty last line (not even a space or tab).
library(testthat)
context("Basic Functions")

test_that("smoke-test", {
returned <- basic(3)
expect_true(!is.null(returned))
})

test_that("vector-test", {
expected <- 4:7
returned <- basic(3:6)
expect_equal(returned, expected)
})
  • Verify that this fails your local check (because we haven't yet created the function basic()).
@DavidBard DavidBard self-assigned this Mar 7, 2017
@DavidBard DavidBard modified the milestone: package-skeleton Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant