 {Promise}      = require 'es6-promise'
 {commonActions} = require './utilities'
 sandbox = null
-ROUTER = null
-CURRENT_ROUTER_PARAMS = null
-CURRENT_ROUTER_PATH   = null
-CURRENT_ROUTER_QUERY = null
-# Mock a router for the context
-beforeEach ->
-  sandbox = sinon.sandbox.create()
-  ROUTER  = sandbox.spy()
-  ROUTER.makeHref = sandbox.spy()
-  ROUTER.isActive = sandbox.spy()
-  ROUTER.transitionTo = sandbox.spy()
-  ROUTER.getCurrentPath = sandbox.spy( -> CURRENT_ROUTER_PATH )
-  ROUTER.getCurrentQuery = sandbox.spy( -> CURRENT_ROUTER_QUERY )
-  ROUTER.getLocation = sandbox.spy( ->
-    addChangeListener: sandbox.spy()
-    removeChangeListener: sandbox.spy()
-  )
-  ROUTER.match = sandbox.spy()
-  ROUTER.getCurrentParams = sandbox.spy( -> CURRENT_ROUTER_PARAMS )
-afterEach ->
-  sandbox.restore()
 
-# A wrapper component to setup the router context
 Wrapper = React.createClass
-  childContextTypes:
-    router: React.PropTypes.func
-  getChildContext: ->
-    router: ROUTER
+
   render: ->
     React.createElement(@props._wrapped_component,
       _.extend(_.omit(@props, '_wrapped_component'), ref: 'element')


}

# Hide the router behind a defined property so it can access the ROUTER variable that's set in the beforeEach
Object.defineProperty(Testing, 'router', {
  get: -> ROUTER
})

module.exports = {Testing, expect, sinon, React, _, ReactTestUtils}


  renderComponent: (component, options = {}) ->
    options.props ||= {}
    unmountAfter = options.unmountAfter or 1
    root = document.createElement('div')
    promise = new Promise( (resolve, reject) ->
