         emitter = new EventEmitter()
         emitter.on "newListener", ->
           soon -> emitter.emit "data", "x"
-        take 1, Bacon.fromEventTarget(emitter, "data")
+        take 1, Bacon.fromEvent(emitter, "data")
       ["x"]
     )
 


  it "should create EventStream from on/off event", ->
    values = []
    take(1, Bacon.fromEventTarget(mockSource, "test")).onValue (value) ->
      values.push(value)

  it "toString", ->
    expect(Bacon.fromEventTarget(mockSource, "click").toString()).to.equal("Bacon.fromEvent({on:function,off:function},click)")



        emitter = new EventEmitter()
        emitter.on "newListener", ->
          soon -> emitter.emit "data", "x", "y"
        take 1, Bacon.fromEvent(emitter, "data", (x, y) => [x, y])
      [["x", "y"]]
    )

  it "should clean up event listeners from EventEmitter", ->
    emitter = new EventEmitter()
    take(1, Bacon.fromEvent(emitter, "data")).subscribe ->
    emitter.emit "data", "x"
    expect(emitter.listeners("data").length).to.deep.equal(0)

  it "should clean up event listeners from DOM object", ->
    emitter = new EventEmitter()
    element = toEventTarget emitter
    dispose = Bacon.fromEvent(element, "click").subscribe ->
    dispose()
    expect(emitter.listeners("click").length).to.deep.equal(0)

