From c9945672fc4cdf3c2f871bf2ac626c3f1d6c4982 Mon Sep 17 00:00:00 2001 From: Nigel Kibodeaux Date: Thu, 1 Dec 2016 11:06:29 -0600 Subject: [PATCH] test: modernize test-fs-truncate-fd - changed `var` to `const` where variables were not reassigned. - changed `assert.equal` to `assert.strictEqual` because there was no downside to being more rigorous. PR-URL: https://github.com/nodejs/node/pull/9978 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- test/parallel/test-fs-truncate-fd.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-fs-truncate-fd.js b/test/parallel/test-fs-truncate-fd.js index 2514b80f09..526612870d 100644 --- a/test/parallel/test-fs-truncate-fd.js +++ b/test/parallel/test-fs-truncate-fd.js @@ -1,17 +1,17 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); -var tmp = common.tmpDir; +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); +const tmp = common.tmpDir; common.refreshTmpDir(); -var filename = path.resolve(tmp, 'truncate-file.txt'); +const filename = path.resolve(tmp, 'truncate-file.txt'); fs.writeFileSync(filename, 'hello world', 'utf8'); -var fd = fs.openSync(filename, 'r+'); +const fd = fs.openSync(filename, 'r+'); fs.truncate(fd, 5, common.mustCall(function(err) { assert.ok(!err); - assert.equal(fs.readFileSync(filename, 'utf8'), 'hello'); + assert.strictEqual(fs.readFileSync(filename, 'utf8'), 'hello'); })); process.on('exit', function() {