View source: R/test_framework.R
testThat | R Documentation |
Run a test function, using testthat framework.
In addition to calling testthat::test_that()
.
testThat(msg, fct, biodb = NULL, conn = NULL, opt = NULL)
msg |
The test message. |
fct |
The function to test. |
biodb |
A valid BiodbMain instance to be passed to the test function. |
conn |
A connector instance to be passed to the test function. |
opt |
A set of options to pass to the test function. |
No value returned.
# Define a context before running tests: biodb::testContext("Test my database connector.") # Instantiate a BiodbMain instance for testing biodb <- biodb::createBiodbTestInstance() # Define a test function my_test_function <- function(biodb) { # Do my tests... } # Run test biodb::testThat("My test works", my_test_function, biodb=biodb) # Terminate the instance biodb$terminate()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.