import test from 'tape'
import EventEmitter from './index.js'

test('event-emitter', t => {
  t.test('on', t => {
    const emitter = new EventEmitter()
    const type = 'foo'
    const func = () => {
    }
    emitter.on(type, func)
    t.ok(emitter._handlers.get(type).has(func))
    t.end()
  })
  t.test('off', t => {
    const emitter = new EventEmitter()
    const type = 'foo'
    const func = () => {
    }
    emitter.on(type, func)
    t.ok(emitter.off(type, func))
    t.end()
  })
  t.test('emit', t => {
    const emitter = new EventEmitter()
    const type = 'foo'
    const data = 'baz'
    const func = (arg) => {
      t.equal(arg, data)
      t.end()
    }
    emitter.on(type, func)
    emitter.emit(type, data)
  })
  t.end()
})

@@ -465,24 +465,118 @@
 ype, func))%0A
+    t.notOk(emitter.off(type, () =%3E %7B%7D))%0A    t.notOk(emitter.off('undefined type', () =%3E %7B%7D))%0A
     t.end()%0A

improve test