title: Jest testing returns undefined with custom Event Emitter
body: <p>I am trying to create a simple event emitter, and when I attempt to test the emitter it is showing up undefined through jest. </p>
  
  <p>Code for the Event Emitter:</p>
  
  <pre><code>    class EventEmitter {
      constructor() {
          this.events = {};
      }
      on(e, fn) {
          if (this.events[e]) {
          return this.event[e].add(fn);
          }
          return this.events[e] = new Set([fn]);
      }
      once(e, fn) {
          if (this.events[e]) {
              this.event[e].add(fn, 1);
          }
          this.events[e] = new Set([fn, 1]);
      }
      emit(e, ...args) {
          if (this.events[e]) {
              this.events[e].forEach(fn =&gt; {
                  if (typeof fn === 'function')
                      fn.apply(null, args);
              });
  
              if (this.events[e].has(1)) {
                  delete this.events[e];
              }
          } else if (!this.events[e]) {
              console.log('Event Argument does not exist - please enter a valid event');
          }
      }
      off(e) {
          if (arguments.length === 0) {
              this.events = {};
          }
          if (this.events[e]) {
              delete this.events[e];
          } else if (!this.events[e]) {
              return console.log('Event Argument does not exist - please enter a valid event');
          }
      }
  }
  </code></pre>
  
  <p>Code for the testing:</p>
  
  <pre><code>const EventEmitter = require('../index.js');
  
  // Creating new Event Emitter
  
  test('should Emit named events with a single argument', () =&gt; {
      const ee = new EventEmitter();
      ee.on('multiple', (x, y) =&gt; {
          console.log(`First Argument: ${x}, Second Argument: ${y}`);
      });
      ee.on('single', () =&gt; "Why isnt this working")
      const res = console.log(ee.emit('single'))
    expect(res).toBe('Why isnt this working')
  })
  </code></pre>
  
  <p>const res is returning undefined, but i am not sure why - any help would be so appreciated!</p>