cobalt icon indicating copy to clipboard operation
cobalt copied to clipboard

add testing framework?

Open BarkleyBG opened this issue 7 years ago • 2 comments

I see that you have a file do_not_include/tests.R. It doesn't seem to me that this is strictly in the unit testing framework. If it's not, I think a huge improvement would be to implement a unit testing framework, like from the testthat package.

An easy way to do this is to type in devtools::use_testthat(), and the directory structure will be added. I'd be happy to help you set up your first couple of tests to get you started. If you're interested, please respond below (but don't close the issue)

BarkleyBG avatar Dec 02 '17 19:12 BarkleyBG

If you do want to start using testthat, I recommend you start a "topic branch" for it. This should be a straightforward, but perhaps important change, so it's best to do this in a sub-branch, and not in master.

See this schematic for a helpful idea: You can take your current commit in the master branch and create a new feature/topic/sub-branch called, say testthat. Then, you can work independently in the two branches, and then when the testthat work is good go go, you can merge it back into master.

This way you can avoid messing up any good code while you're implementing something new!

BarkleyBG avatar Dec 02 '17 19:12 BarkleyBG

Hi, I just stumbled upon this issue. An alternative to testthat is tinytest. The advantage is that it doesn't have dependencies. I've never used it, but thought it would be interesting to mention it here.

etiennebacher avatar Jan 01 '21 16:01 etiennebacher