One thing I found refactoring all the JS tests for Karma is that when we wrap a function in a spy, we should **always** restore it afterwards. This prevents leaking into the next spec.

```javascript
beforeEach(function() {
    var spy = sinon.spy(common.mediator, 'emit');
});

afterEach(function() {
    common.mediator.emit.restore();
});
```