praekeltfoundation / diamondash

Dashboard for how we use Graphite
BSD 3-Clause "New" or "Revised" License
6 stars 0 forks source link

Switch to PhantomJS and Karma for client side tests #64

Closed justinvdm closed 11 years ago

justinvdm commented 11 years ago

We are currently using jsdom for our tests, which is a crude approximation when asserting that things work correctly in the browser. Being a headless webkit implementation, PhantomJS will give us results closer to what we would expect in the browser. Additionally, Karma will give us the possibility of running our tests directly in Chrome and Firefox.

justinvdm commented 11 years ago

I ended up adding bower as part of this PR, doing that as its own PR turned out to be a bit complicated. The problem is that we were using our client side dev dependencies (sinon and chai) as node modules previously. Since we were testing from node, we could just require sinon, and things were fine. Now that we are doing actual browser tests, we can't just obtain the sinon script from node_modules/sinon, since the repo doesn't actually include the build to be used on the client side. So before we could use karma and phantomjs for our tests, we needed to either manually download the sinon script, keep track of it, and remove it later, or use bower now instead of later.

justinvdm commented 11 years ago

Ready for review. Left a few comments for changes which may seem unrelated.

hodgestar commented 11 years ago

:+1: other than a suggestion to put a note of thanks to glyphicons in the README.md file and have that not be something we have to remember to do later.

hodgestar commented 11 years ago

:+1: