visionmedia/mocha — Issue #300: this.setTimeout in before/beforeEach throws error
Author: timoxley
Created: 2012-03-02 01:48:05+00:00
State: open

Trying to specify the timeout for a before/beforeEach doesn't currently work using `this.timeout()`

```javascript
describe('broken before timeout', function() {
before(function() {
this.timeout(4000)
setTimeout(function() {
done()
}, 3000)
})
})
```

Yields:

```
mocha test.js

.

✖ 1 of 0 tests failed:

1) broken before timeout "before all" hook:
TypeError: Cannot call method 'timeout' of undefined
at Context.timeout (/usr/local/lib/node_modules/mocha/lib/context.js:38:14)
...

```