cjohansen/Sinon.JS — Issue #66: Failing tests cause TypeError in JsTestDriver
Author: kwltrs
Created: 2011-12-13 17:10:46+00:00
State: open

When "globalizing" assertions with sinon.assert.expose(this) as described in [Sinons documentation](http://sinonjs.org/docs/#assert-expose), a failing assertion causes a TypeError.

Example:

```javascript
"test something": function() {
var stub = this.stub();
assertCalled(stub);
}
```

Running the test with JsTestDriver causes an error:

```
TypeError: Cannot read property 'fail' of undefined
```

The test should cause an AssertError with a proper error message, as sinon.assert.called does.

Tested with JsTestDriver 1.2.2 and 1.3.3d and Sinon 1.2.0. Full code example and output in this Gist: https://gist.github.com/1472854