Browse Source

test: refactor test-event-emitter-method-names

Improved test by using strictEqual instead of equal.

PR-URL: https://github.com/nodejs/node/pull/10027
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
v4.x
Rodrigo Palma 8 years ago
committed by Myles Borins
parent
commit
542b40f410
  1. 6
      test/parallel/test-event-emitter-method-names.js

6
test/parallel/test-event-emitter-method-names.js

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

Loading…
Cancel
Save