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>
v6
Rodrigo Palma 8 years ago
committed by Evan Lucas
parent
commit
ee8848ddb6
  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 E = events.EventEmitter.prototype;
assert.equal(E.constructor.name, 'EventEmitter');
assert.equal(E.on, E.addListener); // Same method.
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.equal(E[name].name, name);
assert.strictEqual(E[name].name, name);
});

Loading…
Cancel
Save