summaryrefslogtreecommitdiff
path: root/test/parallel/test-event-emitter-modify-in-emit.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2016-04-19 15:37:45 -0700
committerRich Trott <rtrott@gmail.com>2016-04-22 14:38:09 -0700
commita7335bd1f048f6592f609eec0c87c007e98d754c (patch)
tree1f888003dea7c3fb67366ac1a94f418eb7acb168 /test/parallel/test-event-emitter-modify-in-emit.js
parent5eb4ec090d70a848e2ae98bd526634bf9d1bf08c (diff)
downloadnode-new-a7335bd1f048f6592f609eec0c87c007e98d754c.tar.gz
test,benchmark: use deepStrictEqual()
In preparation for a lint rule that will enforce assert.deepStrictEqual() over assert.deepEqual(), change tests and benchmarks accordingly. For tests and benchmarks that are testing or benchmarking assert.deepEqual() itself, apply a comment to ignore the upcoming rule. PR-URL: https://github.com/nodejs/node/pull/6213 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/parallel/test-event-emitter-modify-in-emit.js')
-rw-r--r--test/parallel/test-event-emitter-modify-in-emit.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/parallel/test-event-emitter-modify-in-emit.js b/test/parallel/test-event-emitter-modify-in-emit.js
index cd1849201d..7864438fff 100644
--- a/test/parallel/test-event-emitter-modify-in-emit.js
+++ b/test/parallel/test-event-emitter-modify-in-emit.js
@@ -1,11 +1,11 @@
'use strict';
require('../common');
-var assert = require('assert');
-var events = require('events');
+const assert = require('assert');
+const events = require('events');
var callbacks_called = [];
-var e = new events.EventEmitter();
+const e = new events.EventEmitter();
function callback1() {
callbacks_called.push('callback1');
@@ -29,15 +29,17 @@ assert.equal(1, e.listeners('foo').length);
e.emit('foo');
assert.equal(2, e.listeners('foo').length);
-assert.deepEqual(['callback1'], callbacks_called);
+assert.deepStrictEqual(['callback1'], callbacks_called);
e.emit('foo');
assert.equal(0, e.listeners('foo').length);
-assert.deepEqual(['callback1', 'callback2', 'callback3'], callbacks_called);
+assert.deepStrictEqual(['callback1', 'callback2', 'callback3'],
+ callbacks_called);
e.emit('foo');
assert.equal(0, e.listeners('foo').length);
-assert.deepEqual(['callback1', 'callback2', 'callback3'], callbacks_called);
+assert.deepStrictEqual(['callback1', 'callback2', 'callback3'],
+ callbacks_called);
e.on('foo', callback1);
e.on('foo', callback2);
@@ -53,5 +55,5 @@ e.on('foo', callback2);
e.on('foo', callback3);
assert.equal(2, e.listeners('foo').length);
e.emit('foo');
-assert.deepEqual(['callback2', 'callback3'], callbacks_called);
+assert.deepStrictEqual(['callback2', 'callback3'], callbacks_called);
assert.equal(0, e.listeners('foo').length);