Description Usage Arguments Value Examples
Constructor of the class UnitTester
1 | UnitTester(turnWarningsToErrors = TRUE, hidePassed = FALSE)
|
turnWarningsToErrors |
If set to TRUE, all warnings issued within any test method are turned into errors. The default value is TRUE. |
hidePassed |
If set to TRUE, all passed test results are hidden in the output. The is useful when you are only interested in the failed assertions and the unexpected errors. The default value is FALSE. |
an instance of UnitTester
1 2 3 4 5 6 7 8 9 10 11 12 13 | unitTester <- UnitTester()
unitTester$addTest('Test 1', function() {
unitTester$assertEqual(1, 1)
})
unitTester$addTest('Test 2', function() {
unitTester$assertThrow(function() {
stop('Error from Test 2')
})
})
unitTester$runAllTests()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.