Skip to content

Commit

Permalink
test: improve test-stream2-objects.js
Browse files Browse the repository at this point in the history
This commit improves the test cases in
test-stream2-objects.js by using assert.strictEqual
instead of assert.equal.

This is a part of Code And Learn at NodeFest 2016

Fixes: nodejs/code-and-learn#58
PR-URL: #9565
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
kt3k authored and MylesBorins committed Dec 21, 2016
1 parent bd6461d commit 90027c3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/parallel/test-stream2-objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function run() {

// ensure all tests have run
process.on('exit', function() {
assert.equal(count, 0);
assert.strictEqual(count, 0);
});

process.nextTick(run);
Expand Down Expand Up @@ -210,16 +210,16 @@ test('high watermark _read', function(t) {

var v = r.read();

assert.equal(calls, 0);
assert.equal(v, '1');
assert.strictEqual(calls, 0);
assert.strictEqual(v, '1');

var v2 = r.read();
assert.equal(v2, '2');
assert.strictEqual(v2, '2');

var v3 = r.read();
assert.equal(v3, '3');
assert.strictEqual(v3, '3');

assert.equal(calls, 1);
assert.strictEqual(calls, 1);

t.end();
});
Expand All @@ -232,7 +232,7 @@ test('high watermark push', function(t) {
r._read = function(n) {};
for (var i = 0; i < 6; i++) {
var bool = r.push(i);
assert.equal(bool, i === 5 ? false : true);
assert.strictEqual(bool, i !== 5);
}

t.end();
Expand Down Expand Up @@ -309,7 +309,7 @@ test('buffers finish until cb is called', function(t) {
var called = false;

w._write = function(chunk, encoding, cb) {
assert.equal(chunk, 'foo');
assert.strictEqual(chunk, 'foo');

process.nextTick(function() {
called = true;
Expand All @@ -318,7 +318,7 @@ test('buffers finish until cb is called', function(t) {
};

w.on('finish', function() {
assert.equal(called, true);
assert.strictEqual(called, true);

t.end();
});
Expand Down

0 comments on commit 90027c3

Please sign in to comment.