you can use:
```javascript
sinon.assert.calledWithMatch(window.dispatchEvent, { type: 'batteryshutdown' });
```

Isn't this a lot more readable ? :)