This is a little bit more tricky. If you do this, you never miss this test. Because you force the onerror callback to be executed by the simple fact of be assigned. Something similar happen with the `resetData wifi interface` and `resetData mobile interface` tests. To do this in a proper way you need to replace the `clearStats` method with a specific function with [controlled behaviour](http://sinonjs.org/docs/#stubs-api):

```javascript
sinon.stub(MockMozNetworkStats, 'clearStats', getFailingClearStats);
sinon.stub(MockMozNetworkStats, 'clearStats', getSuccessfulClearStats);
```

Now, these `getSuccessfulClearStats` and `getFailingClearStats()` are function builders that proxy a more generic builder `getCustomClearStats()` implemented this way:

```javascript
function getCustomClearStats(willFail) {
  return function () {
    var request = {};
    setTimeout(function() {
      if (willFail) {
        request.error = { name: 'error' };
        request.onerror && request.onerror();
      } else {
        request.result = {};
        request.onsuccess && request.onsuccess();
      }
    }, 0);
    return request;
  }
}
```

To install the stubs this way, you need to restore the real `clearStats` in each iteration. I advice you to get it in the suite setup and manually restore in the by-test setup.