ericam/true — pull request #21 by carljm (2014-12-10 10:04:40+00:00)
Title: JS runner for True tests.

It works! In this pull request, True's own Sass tests are now run through Mocha. You can see them pass if you run `make test` (after having done an `npm install`). If you add some failing tests, you can see what it looks like when tests fail.

There's no way (that I could find) to write a plugin for Mocha so it will directly discover SCSS files (py.test could do that - maybe we should write this in Python instead :P). So you have to have a `test_*.js` file in your project with just a couple lines of boilerplate for Mocha to find and run your True tests. You can see in `test/test_main.js` what that looks like: the two lines under the `// run True's True (Sass) tests` comment (plus the `var path = ...` and `var main = ...` `require` lines above that) are all that's necessary.

I think this PR could be merged as-is, but here are some things that could be done that I haven't yet:

- [ ] write usage docs
- [ ] add support for other JS test runners (any that use nested syntax similar to Mocha may already work)

I'm sure you'll also have opinions on the output format for failed tests once you start using it, so that'll probably take some tweaking over time.