summaryrefslogtreecommitdiff
path: root/test/parallel/test-stream-big-push.js
diff options
context:
space:
mode:
authorItalo A. Casas <me@italoacasas.com>2016-09-20 13:41:57 -0400
committerIlkka Myller <ilkka.myller@nodefield.com>2016-09-23 00:54:35 +0300
commit4d958725b47bf58a90b73b6fd399f7322d89c8ed (patch)
treeeb71bc801c32ea91facbe0646fcc42168ed2fffa /test/parallel/test-stream-big-push.js
parente7d4176f01da90d9d73553aa0b9e653a19dfb17e (diff)
downloadnode-new-4d958725b47bf58a90b73b6fd399f7322d89c8ed.tar.gz
test: cleanup stream tests
const and let instead var assert.strictEqual instead assert.equal PR-URL: https://github.com/nodejs/node/pull/8668 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test/parallel/test-stream-big-push.js')
-rw-r--r--test/parallel/test-stream-big-push.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/parallel/test-stream-big-push.js b/test/parallel/test-stream-big-push.js
index b46665efc9..d9b79ebafc 100644
--- a/test/parallel/test-stream-big-push.js
+++ b/test/parallel/test-stream-big-push.js
@@ -1,17 +1,17 @@
'use strict';
require('../common');
-var assert = require('assert');
-var stream = require('stream');
-var str = 'asdfasdfasdfasdfasdf';
+const assert = require('assert');
+const stream = require('stream');
+const str = 'asdfasdfasdfasdfasdf';
-var r = new stream.Readable({
+const r = new stream.Readable({
highWaterMark: 5,
encoding: 'utf8'
});
-var reads = 0;
-var eofed = false;
-var ended = false;
+let reads = 0;
+let eofed = false;
+let ended = false;
r._read = function(n) {
if (reads === 0) {
@@ -21,7 +21,7 @@ r._read = function(n) {
reads++;
} else if (reads === 1) {
var ret = r.push(str);
- assert.equal(ret, false);
+ assert.strictEqual(ret, false);
reads++;
} else {
assert(!eofed);
@@ -40,9 +40,9 @@ var ret = r.push(str);
// should be false. > hwm
assert(!ret);
var chunk = r.read();
-assert.equal(chunk, str);
+assert.strictEqual(chunk, str);
chunk = r.read();
-assert.equal(chunk, null);
+assert.strictEqual(chunk, null);
r.once('readable', function() {
// this time, we'll get *all* the remaining data, because
@@ -50,15 +50,15 @@ r.once('readable', function() {
// us below the hwm, and so it triggered a _read() again,
// which synchronously added more, which we then return.
chunk = r.read();
- assert.equal(chunk, str + str);
+ assert.strictEqual(chunk, str + str);
chunk = r.read();
- assert.equal(chunk, null);
+ assert.strictEqual(chunk, null);
});
process.on('exit', function() {
assert(eofed);
assert(ended);
- assert.equal(reads, 2);
+ assert.strictEqual(reads, 2);
console.log('ok');
});