3 ms·
One of the most common test modules in R is called “test that” and you invoke a test by calling a function (rather than defining one) called “test_that”, the fi
by wodenokoto 6y ago
One of the most common test modules in R is called “test that” and you invoke a test by calling a function (rather than defining one) called “test_that”, the first argument is a string containing a description of what you want to test and the second argument is the code you want to test.
That way, all your unit tests reads: “test that error message is displayed when refresh times out” etc.
I think it’s a really nice way to lay things out and it avoids all the “magic” of some functions being executed by virtue of their name.