Skip to content

Commit 47b5f9e

Browse files
NigelKibodeauxFishrock123
authored andcommitted
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: #9978 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 8b6c45f commit 47b5f9e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/parallel/test-fs-truncate-fd.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
4-
var path = require('path');
5-
var fs = require('fs');
6-
var tmp = common.tmpDir;
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const path = require('path');
5+
const fs = require('fs');
6+
const tmp = common.tmpDir;
77
common.refreshTmpDir();
8-
var filename = path.resolve(tmp, 'truncate-file.txt');
8+
const filename = path.resolve(tmp, 'truncate-file.txt');
99

1010
fs.writeFileSync(filename, 'hello world', 'utf8');
11-
var fd = fs.openSync(filename, 'r+');
11+
const fd = fs.openSync(filename, 'r+');
1212
fs.truncate(fd, 5, common.mustCall(function(err) {
1313
assert.ok(!err);
14-
assert.equal(fs.readFileSync(filename, 'utf8'), 'hello');
14+
assert.strictEqual(fs.readFileSync(filename, 'utf8'), 'hello');
1515
}));
1616

1717
process.on('exit', function() {

0 commit comments

Comments
 (0)