visionmedia/mocha — pull request #470 by halkeye (2012-06-20 23:56:58+00:00)
Title: mocha doesn't fire test end for 'before' test failures

When a mocha tests bails out in the before block, it does't emit a test end event.
This causes the xunit format to not include any testcases, which breaks some (jenkins) junit xml parsing.

I'm not sure what the desired behaviour is, but I've applied this patch to our local install and find the xml now includes failure messages for the before tests.

Use case provided:

$ mocha test.js
```

✔ 0 tests complete (1ms)

```
$ mocha test.js --reporter xunit
```xml

```
$ cat test.js
```javascript
describe("before-fails", function() {
before(function(done) {
// undefined function
die("script dies");
});
});
```