The testwhat
package provides rich functionality to write Submission Correctness Tests for interactive R exercises on the DataCamp platform. The package is inspired by Hadley Wickham's testthat
package, the standard for unit testing in R. For a detailed guide on how to use testwhat
, head over to the wiki. To learn more about course creation for DataCamp, visit our Teach Documentation.
library("devtools")
install_github("datacamp/testwhat")
Because testwhat
depends on proprietary R packages, you can only run the tests on a system that has these packages installed. If you have the private codecov token, you can also upload the coverage results:
# Run the tests locally
devtools::test()
# Run only a part of the tests
devtools::test(filter = "test-object")
# Upload code coverage report to codecov.io
covr::codecov(token = "private_token")
For more details, questions and suggestions, you can contact learn-engineering@datacamp.com.