     hx.select('#fixture').selectAll('span').style('display', 'block').style('display')
     hx.select('#fixture').select('span').style('display', 'inline-block').style('display')
 
-    consoleWarn = chai.spy.on(console, 'warn')
+    hx.consoleWarning = chai.spy()
 
   afterEach ->
     hx.select('#fixture').remove()

    hx.select('#grandchild').closest('#thing-that-doesnt-exist').empty().should.equal(true)

  it 'closest should warn when you give a non string argument', ->
    consoleWarning = chai.spy.on(hx, 'consoleWarning')

    obj = {}

    hx.select('#fixture').closest(obj)
    consoleWarning.should.have.been.called.with('Selection.closest was passed the wrong argument type', 'Selection.closest only accepts a string argument, you supplied:', obj)

  it 'closest should warn when you give a non string argument', ->
    hx.select('#fixture').closest('potato').empty().should.equal(true)

    selection = hx.select('#fixture').selectAll('span')
    appended = selection.append(document.createElement('h1'))
    appended.size().should.equal(0)
    hx.consoleWarning.should.have.been.called()

  it 'appending an existing element to an empty selection should do nothing', ->
    selection = hx.select('#empty').select('span')
