Skip to content

Commit

Permalink
test: cleanup parallel/test-file-write-stream2.js
Browse files Browse the repository at this point in the history
replace ==, !=, some instances of var, and assert.equal()

PR-URL: nodejs#8770
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
  • Loading branch information
Jenna Vuong authored and imyller committed Sep 27, 2016
1 parent 73ae2d1 commit 782db08
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/parallel/test-file-write-stream2.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ var fs = require('fs');
var filepath = path.join(common.tmpDir, 'write.txt');
var file;

var EXPECTED = '012345678910';
const EXPECTED = '012345678910';

var cb_expected = 'write open drain write drain close error ';
const cb_expected = 'write open drain write drain close error ';
var cb_occurred = '';

var countDrains = 0;
Expand Down Expand Up @@ -48,7 +48,7 @@ file = fs.createWriteStream(filepath, {
file.on('open', function(fd) {
console.error('open');
cb_occurred += 'open ';
assert.equal(typeof fd, 'number');
assert.strictEqual(typeof fd, 'number');
});

file.on('drain', function() {
Expand All @@ -57,12 +57,12 @@ file.on('drain', function() {
++countDrains;
if (countDrains === 1) {
console.error('drain=1, write again');
assert.equal(fs.readFileSync(filepath, 'utf8'), EXPECTED);
assert.strictEqual(fs.readFileSync(filepath, 'utf8'), EXPECTED);
console.error('ondrain write ret=%j', file.write(EXPECTED));
cb_occurred += 'write ';
} else if (countDrains == 2) {
} else if (countDrains === 2) {
console.error('second drain, end');
assert.equal(fs.readFileSync(filepath, 'utf8'), EXPECTED + EXPECTED);
assert.strictEqual(fs.readFileSync(filepath, 'utf8'), EXPECTED + EXPECTED);
file.end();
}
});
Expand All @@ -85,6 +85,6 @@ for (var i = 0; i < 11; i++) {
console.error('%d %j', i, ret);

// return false when i hits 10
assert.strictEqual(ret, i != 10);
assert.strictEqual(ret, i !== 10);
}
cb_occurred += 'write ';

0 comments on commit 782db08

Please sign in to comment.