We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello!
I am looking to unit test some of my code. My instinct was to use mocha and chai assertion libraries but I wanted to see if anyone else had done some of this with a processing sketch before and had any tips/best practices?
Cheers
Answers
Building it with Mocha and Chai! It works!
@andrewjtimmons:
Could you grace us with an example of how you wrote your mocha tests? The first things I stumbled on was how to require() the requisite p5 module. If I simply put
at the head of my test file, then mocha errors out with
Then there's the small matter of how you wrap a p5 instance around the entire test, but I'm happy to take one step at a time. :)