aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-event-emitter-method-names.js
blob: 27c01b2a0781c510a9615f95bddeadf31e770005 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict';
require('../common');
const assert = require('assert');
const events = require('events');

var E = events.EventEmitter.prototype;
assert.strictEqual(E.constructor.name, 'EventEmitter');
assert.strictEqual(E.on, E.addListener);  // Same method.
Object.getOwnPropertyNames(E).forEach(function(name) {
  if (name === 'constructor' || name === 'on') return;
  if (typeof E[name] !== 'function') return;
  assert.strictEqual(E[name].name, name);
});