twitter/flight — pull request #114 by necolas (2013-05-26 21:45:11+00:00)
Title: Switch test setup to Karma

A variety of changes that result in a new and improved (IMO) test setup:

* Switch to using the [Karma](http://karma-runner.github.io) test runner. It wires up the test specs, library code, and test framework. All you need are a couple of config files. Also means we are actually testing against the client-side libraries Bower is installing, rather than duplicates in the test directory.

Testing that Flight works with jQuery 1.9.x or 2.0.x should now involve just this:

```
bower install --save jquery#1.9.x
make test
````

* Configure Travis CI to install Bower and Bower packages before running tests. Also get it to run tests in Node.js 0.10 as well as 0.8.

* Add development notes to the CONTRIBUTING.md so others can get the test environment setup.

* Some small, related cleanup tasks in the docs, `package.json`, and `.gitignore`.

You still run the standalone build and tests with `make test`, it just passes through Karma instead. To be able to run the CI tests on the Twitter machines, Karma needs to know about the custom PhantomJS install location we end up with. Add this to your `.bash_profile` (or the local config for it):

`export PHANTOMJS_BIN="$(brew --prefix)/bin/phantomjs`

As an added bonus, during development, you can just run `karma start` (if you also install Karma globally: `npm install -g karma`) and it will watch your tests in Firefox and Chrome.

Let me know what you think or if I've missed anything.