I’m pretty interested in this topic as well. One thing I’ve started doing is looking around at the rest of the software community, past and present, to see what I can learn from them.
Angular in particular has put quite a bit of thought into the topic - specifically their karma test runner is a piece of art. It’s google’s orignal JSTD driver but without all the hassle. One advantage I see with this over something like konacha is that the tests run on the command line, even though they use a real browser environment – including any version of IE, mobile safari – whatever you want… It boots a server that hooks a websocket(or pulling i suppose for IE) to any browser that chooses to visit yourhost:9876 – when you press command-s, the tests run for any listening browsers. You’d only want to use just chrome by itself for quick feedback, but you could start a second server on another port, point to a different karma.config and connect using another computer on your network or with a CI server - meaning you’d have a safety net in case you break something on other browsers while developing, and therefore be able to fix it immediately… It’s not to dis-similar from buster.js - except it’s stable and extremely well maintained(by google employees - and apparently they use it to test like youtube on playstation, their ad network stuff that runs on angular, etc - so it’s not going anywhere anytime soon… )
I have not yet played with konacha, and while I definitely see it’s visual appeal(seeing your tests run is sexy), by definition of the fact that the dom manipulation is the slowest thing in the browser, it must be considerably slower than on the cli. This presentation about karma(formerly known as testacular) is worth checking out – JS.everywhere(Europe) 2012: Testacular, the Spectacular JavaScript Test Runner - Vojta Jína - YouTube — ps, if you watch this vid, it’s gonna make you want to add tests to ember documentation, the way angular has done… (that would be a nice eventual goal, one I would gladly be apart of)
Furthermore(these notes are random, sorry), setting a project up is a simple as npm -g install karma, cd your/app/dir, then run karma init
– it then asks you if want to use jasmine, qunit or mocha. You can also strap your own adapter – for example, you could(in theory, want to try) use casper.js by itself, or possibly in conjunction with cucumber.js(if that’s your style) to do high level acceptance testing(outside of rails!)… It’ll also compile your coffeescript on the fly – it honestly looks like the like the shi* — its even got growl notification – let’s see what am I leaving out –
ah yes, here’s a fun fact – the name used to be testacular but changed to karma at the prodding of members from the ember crew – tom dale, ryan florence, eviltrout, etc – here’s the issue - https://github.com/karma-runner/karma/issues/376 - its funny and worth reading the comments…
Finally(long post, sorry), getting to what we can learn from the past, I am curious if anyone has any experience or comments regarding the similarities that may exist between testing ember apps and testing C#, winform, smalltalk apps, etc using the traditional MVC fat client architectures. Martin Fowler, Michael Feathers and Jeremy Miller(to name a few) have a bit to say on the subject, it’s worth reading - here are some links if your interested…
GUI Architectures (overview of the design patterns ember seems to pull from)
Vacation Rental Hacks (a rather famous example of testing said design patterns)
http://codebetter.com/jeremymiller/2007/07/26/the-build-your-own-cab-series-table-of-contents/ (a crazy in depth almost book on the topic, linked to from one of the previous or someone related(dont remember))
In general, it seems we are facing the same problem as others have faced, so it would seem wise to use what they’ve learned and re-apply it here…
@emk - let me know if your interested in exchanging ideas, or anyone else on this thread for that matter - I am still way new to ember, but I find that the best way to learn something is by poking it with tests until I build up a suite that represents my understanding of the framework/language I am using… so, thanks everyone who contributes code samples here and around the web that include tests
– cheers