hySpc.testthat

Build Status on Travis Build status on Appveyor (master branch) Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Codecov test coverage pkgdown

This package provides some addons for testthat used by hyperSpec and hySpc.*.

Online documentation is available via pkgdown.

hySpc.testthat allows to attach unit tests to functions:

f <- function(x) 2*x

test(f) <- function(){
  context("testing f")
  
  test_that("foo", expect (bar))
}

to keep test code and functional code close to each other.

Functions test_fun() and unittest() execute unit tests that are thus attached to functions.

See tests/testthat/test_attached.R for including these tests into the usual test suit executed by devtools::test().