busterjs/buster — Issue #61: unhelpful failure message from assert.exception
Author: rvagg
Created: 2012-01-25 06:08:32+00:00
State: open

I'm not sure if this has anything to do with #21 but here goes:

```js
var assert = require('buster').assert
buster.testCase('test assert.exception', {
'assert.exception(fn)': function () {
assert.exception(function () {
// should fail
})
},
'assert.exception(fn, type)': function () {
assert.exception(function () {
// should fail
}, 'SomeError')
}
})
```

```
$ buster-test
Error: test assert.exception assert.exception(fn)
TypeError: Cannot call method 'getClient' of undefined

Error: test assert.exception assert.exception(fn, type)
TypeError: Cannot call method 'getClient' of undefined

1 test case, 2 tests, 0 assertions, 0 failures, 2 errors, 0 timeouts
WARNING: No assertions!
```

What's with the `TypeError`? Looks like a problem internal to Buster or Sinon to me although I can't find it in the source. Just a "did not throw exception [of type '']" would be nice.