ceejbot/opsbot — pull request #2 by othiym23 (2014-03-27 04:00:03+00:00)
Title: test: mocha -> lab

You may decide, after reviewing this, that you don't want to take this PR. That's OK! It's actually a deceptively significant change. Let me lay out the pluses, ehs, and minuses of `lab` vs `mocha`:

#### pluses

+ `lab`, like `tap`, doesn't require you to use the bundled CLI to run tests. `node test/test-01-basics.js` works just fine.
+ `lab` doesn't frob the global state of the test files -- all the BDD functions are clearly declared at the head of the file.
+ `lab` is comparatively quite simple and doesn't do anything weird with EEs or global exception handlers (it actually uses domains! See also: all of @hueniverse's complaints about domains!).
+ `lab -r html -o coverage.html` produces a tough, fair, and clean coverage report

#### eh

* `lab` bundles `chai` and exposes its `expect` interface as a property on the module. I've used `chai` for years now, but I actually think the `must` documentation makes a good point about a design flaw in `chai` that's always driven me crazy, which is its promiscuous use of accessors to give a deeply un-JS / Ruby-like interface.
* All `lab` tests are asynchronous, as are `before` / `after` / `beforeEach` / `afterEach`. This is in keeping with its policy of making everything explicit, and it also means that `lab` doesn't have `mocha`'s super-gross arity-based function dispatch, but it does require a little extra boilerplate.
* No highlighting of extra-slow tests. In my experience, this is more an irritating distraction than a useful feature, at least for unit tests.

#### minuses

- No pending tests.
- No spec reporter, only TDD-style dot output.
- No tap reporter (sorry, @isaacs).
- Helvetica Neue Ultra Light in the coverage reports SIGH.