Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: improve test-stream2-objects.js
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
nodejs/code-and-learn#58
  • Loading branch information
kt3k committed Nov 12, 2016
commit 24514d7ae4048c49a8ecfc53a7ef98bb350af99f
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