node/test/parallel/test-event-emitter-method-n...

13 lines
436 B
JavaScript
Raw Normal View History

var common = require('../common');
var assert = require('assert');
var events = require('events');
var E = events.EventEmitter.prototype;
assert.equal(E.constructor.name, 'EventEmitter');
assert.equal(E.on, E.addListener); // Same method.
Object.getOwnPropertyNames(E).forEach(function(name) {
if (name === 'constructor' || name === 'on') return;
2014-06-05 22:46:55 +08:00
if (typeof E[name] !== 'function') return;
assert.equal(E[name].name, name);
});