Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace ==, !=, some instances of var, and assert.equal() #8770

Closed
wants to merge 1 commit into from
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
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 ';