Skip to content

Commit

Permalink
test: cleanup parallel/test-fs-readfile-unlink.js
Browse files Browse the repository at this point in the history
Changes var to const, != to !==, and assert.equal() to assert.strict
Equal()

PR-URL: #8764
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
  • Loading branch information
nohman20 authored and imyller committed Sep 27, 2016
1 parent 782db08 commit e5f5f3a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/parallel/test-fs-readfile-unlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ const fs = require('fs');
const path = require('path');
const dirName = path.resolve(common.fixturesDir, 'test-readfile-unlink');
const fileName = path.resolve(dirName, 'test.bin');

var buf = Buffer.alloc(512 * 1024, 42);
const buf = Buffer.alloc(512 * 1024, 42);

try {
fs.mkdirSync(dirName);
} catch (e) {
// Ignore if the directory already exists.
if (e.code != 'EEXIST') throw e;
if (e.code !== 'EEXIST') throw e;
}

fs.writeFileSync(fileName, buf);

fs.readFile(fileName, function(err, data) {
assert.ifError(err);
assert.equal(data.length, buf.length);
assert.strictEqual(data.length, buf.length);
assert.strictEqual(buf[0], 42);

fs.unlinkSync(fileName);
Expand Down

0 comments on commit e5f5f3a

Please sign in to comment.