slightlyoff/cassowary.js — pull request #39 by bitpshr (2013-06-11 05:45:35+00:00)
Title: Switch from Mocha to Intern

After checking out the cassowary.js tests, I noticed there were a few hacks to get Mocha to behave properly. Further, it didn't have true standalone browser support, a way to easily test against all browsers, or a way to generate code coverage. I also was extremely bored and had to kill some time today, so I decided to switch the tests to use [Intern](http://theintern.io) instead.

* **Run tests via the command line**:
`npm test`

* **Run tests in directly in a local**:
point browser at `tests/unittests.html?config=tests/intern`

* **Run tests against all supported runtimes using Selenium**:
`node node_modules/intern/runner.js config=tests/intern`
*Note: The simplest way to run tests against Selenium is by using [SauceLabs](https://saucelabs.com/account). Just create an account, and expose `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` as environment variables. Intern takes care of the rest.*
![screen shot 2013-06-11 at 1 26 43 am](https://f.cloud.github.com/assets/334586/635540/45b716fc-d257-11e2-8281-f668e6e9d31c.png)

* **Generate a full lcov code coverage report**:
`node node_modules/intern/runner.js config=tests/intern reporters=lcov`
*Note: Requires a Selenium server, see step above. This will generate an `lcov.info` file. As with any lcov report, an html page can be generated to view results using `genhtml lcov.info`.*
![screen shot 2013-06-11 at 1 38 50 am](https://f.cloud.github.com/assets/334586/635567/01694e78-d259-11e2-9ca5-c662cbafdd18.png)