```coffeescript
class FakeWindow
  clearInterval: sinon.spy()
  setInterval: sinon.spy -> Math.random()
  localStorage:
    getItem: sinon.stub().returns('[]')
    setItem: sinon.stub()
  document:
    hidden: false


module.exports = FakeWindow
```

Make FakeWindow spy on itself when instantiated
user
```coffeescript
_ = require 'underscore'

EmptyFn = ->
  return undefined

class FakeWindow
  clearInterval: EmptyFn
  setInterval: -> Math.random()
  localStorage:
    getItem: -> []
    setItem: EmptyFn
  document:
    hidden: false

  constructor: ->
    for method in _.functions(@)
      sinon.spy(@, method)

module.exports = FakeWindow
```
assistant