Here at Digital Natives we are devoted to support the automated testing of our applications. Lately we write more and more complex business logics on front-end side therefore we need to test front-end side codes more accurately. I put together a presentation for our weekly developer meeting concerning this topic, where I reviewed the current possibilities, but I think that it might be interesting for other front-end programmers too.
The code mentioned in the presentation is available on our Github page.
The list of the used technologies might be useful too:
Mocha
JavaScript test framework that can run in a browser and under Node.js as well. This gives the opportunity to run tests on the front-end and back-end sides (if the backend is a Node.js application).
Chai
An assertation extension I've chosen for Mocha.
SinonJS
Spy/Stub/Mock library for JavaScript. With fake HTTPrequests the browser's HTTP queries can be mocked.
Karma
JavaScript test runner that is able to run the tests in multiple browsers at the same time (even in phantomjs).
Browserify
Module loader for JavaScript. You can use Node.js's require system in the browser.
Grunt
Task runner via Node. Runs predefined tasks, in batch if needed. A really good tool to easily configure developer or deployed environments.
Schemata
Schema validator. Can be used on both client and server side, to use the same model's code on the client and its corresponding server side without duplication.
Viktor Somodi