LoungeDestroyer
LoungeDestroyer copied to clipboard
Unit testing
We need it.
Some input from someone experienced with this would be nice.
I'll dig into this once I finish up the site and logo. Unit testing is going to be difficult since, from what I've seen at least, most of the functionality is actually completely coupled with the user interface. There aren't many functions that simply manipulate data, or do some basic functionality that fits unit testing. Correct me if I'm wrong.
That being said, ui tests that interact with the csgolounge interface will do the job. I'd vote on http://webdriver.io/ for UI bindings/actions and mocha for testing framework (that provides assertions etcetc).
Wrote my first few tests for Items class, only took 7 months to finally get started. :D
Not finished yet, there needs to be some refactoring done, for example fetchSteamMarketPrice
does not have any callbacks therefor I cannot really test it, yet.
To install it just npm install mocha
and npm install chai
, then you just open tests.html
in the browser and it should run the tests.