Skip to content

Commit 153ddbb

Browse files
committed
cleaning up
1 parent 5314195 commit 153ddbb

12 files changed

+25
-29
lines changed

test/assertions.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-octal */
22

3-
var
3+
const
44
assert = require('assert'),
55
fs = require('fs'),
66
path = require('path'),
@@ -18,7 +18,7 @@ module.exports.assertName = function assertName(name, expected) {
1818

1919

2020
module.exports.assertMode = function assertMode(name, mode) {
21-
var stat = fs.statSync(name);
21+
const stat = fs.statSync(name);
2222

2323
// mode values do not work properly on Windows. Ignore “group” and
2424
// “other” bits then. Ignore execute bit on that platform because it
@@ -57,7 +57,7 @@ module.exports.assertProperResult = function assertProperResult(result, withfd)
5757

5858
module.exports.assertExists = function assertExists(name, isfile) {
5959
assert.ok(existsSync(name), name + ' should exist');
60-
var stat = fs.statSync(name);
60+
const stat = fs.statSync(name);
6161
if (isfile) assert.ok(stat.isFile(), name + ' should be a file');
6262
else assert.ok(stat.isDirectory(), name + ' should be a directory');
6363
};

test/dir-sync-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-octal */
22
// vim: expandtab:ts=2:sw=2
33

4-
var
4+
const
55
assert = require('assert'),
66
fs = require('fs'),
77
path = require('path'),

test/dir-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-octal */
22
// vim: expandtab:ts=2:sw=2
33

4-
var
4+
const
55
assert = require('assert'),
66
fs = require('fs'),
77
path = require('path'),
@@ -20,7 +20,7 @@ describe('tmp', function () {
2020
describe('#dir()', function () {
2121
describe('when running inband standard tests', function () {
2222
inbandStandardTests(false, function before(done) {
23-
var that = this;
23+
const that = this;
2424
tmp.dir(this.opts, function (err, name, removeCallback) {
2525
if (err) return done(err);
2626
that.topic = { name: name, removeCallback: removeCallback };

test/file-sync-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-octal */
22
// vim: expandtab:ts=2:sw=2
33

4-
var
4+
const
55
assert = require('assert'),
66
fs = require('fs'),
77
inbandStandardTests = require('./inband-standard'),

test/inband-standard.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-octal */
22
// vim: expandtab:ts=2:sw=2
33

4-
var
4+
const
55
assert = require('assert'),
66
fs = require('fs'),
77
path = require('path'),
@@ -12,7 +12,7 @@ var
1212

1313

1414
module.exports = function inbandStandard(isFile, beforeHook) {
15-
var testMode = isFile ? 0600 : 0700;
15+
const testMode = isFile ? 0600 : 0700;
1616
describe('without any parameters', inbandStandardTests({ mode: testMode, prefix: 'tmp-' }, null, isFile, beforeHook));
1717
describe('with prefix', inbandStandardTests({ mode: testMode }, { prefix: 'something' }, isFile, beforeHook));
1818
describe('with postfix', inbandStandardTests({ mode: testMode }, { postfix: '.txt' }, isFile, beforeHook));

test/issue129-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-octal */
22
// vim: expandtab:ts=2:sw=2
33

4-
var
4+
const
55
assert = require('assert'),
66
assertions = require('./assertions'),
77
childProcess = require('./child-process').childProcess;

test/name-sync-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-octal */
22
// vim: expandtab:ts=2:sw=2
33

4-
var
4+
const
55
assert = require('assert'),
66
inbandStandardTests = require('./name-inband-standard'),
77
tmp = require('../lib/tmp');

test/name-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-octal */
22
// vim: expandtab:ts=2:sw=2
33

4-
var
4+
const
55
assert = require('assert'),
66
inbandStandardTests = require('./name-inband-standard'),
77
tmp = require('../lib/tmp');
@@ -11,7 +11,7 @@ describe('tmp', function () {
1111
describe('#tmpName()', function () {
1212
describe('when running inband standard tests', function () {
1313
inbandStandardTests(function before(done) {
14-
var that = this;
14+
const that = this;
1515
tmp.dir(this.opts, function (err, name) {
1616
if (err) return done(err);
1717
that.topic = name;

test/spawn-custom.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
// vim: expandtab:ts=2:sw=2
22

3-
var
3+
const
44
path = require('path'),
55
readJsonConfig = require('./util').readJsonConfig,
6-
spawn = require('./spawn');
6+
spawn = require('./spawn'),
7+
config = readJsonConfig(process.argv[2]);
78

8-
var config = readJsonConfig(process.argv[2]);
99
spawn.graceful = !!config.graceful;
1010

11-
var args = [];
12-
13-
for (var i=3; i<process.argv.length; i++) {
14-
args[i-3] = process.argv[i];
15-
}
11+
const args = Array.prototype.slice.call(process.argv, 3);
1612

1713
// import the test case function and execute it
18-
var fn = require(path.join(__dirname, 'outband', config.tc));
14+
const fn = require(path.join(__dirname, 'outband', config.tc));
1915
fn.apply(spawn, args);
2016

test/spawn-generic.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// vim: expandtab:ts=2:sw=2
22

3-
var
3+
const
44
path = require('path'),
55
readJsonConfig = require('./util').readJsonConfig,
66
spawn = require('./spawn'),
7-
tmp = require('../lib/tmp');
7+
tmp = require('../lib/tmp'),
8+
config = readJsonConfig(process.argv[2]);
89

9-
var config = readJsonConfig(process.argv[2]);
1010
spawn.graceful = !!config.graceful;
1111

1212
var fnUnderTest = null;
@@ -18,7 +18,7 @@ else fnUnderTest = (config.file) ? tmp.fileSync : tmp.dirSync;
1818
if (config.graceful) tmp.setGracefulCleanup();
1919

2020
// import the test case function and execute it
21-
var fn = require(path.join(__dirname, 'outband', config.tc));
21+
const fn = require(path.join(__dirname, 'outband', config.tc));
2222
if (config.async)
2323
fnUnderTest(config.options, function (err, name, fdOrCallback, cb) {
2424
if (err) spawn.err(err);

test/spawn.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = {
3030
process.exit(code || 0);
3131
},
3232
kill: function (signal) {
33-
process.kill(process.pid, signal || 'SIGINT');
33+
process.kill(signal || 'SIGINT');
3434
}
3535
};
3636

test/util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// vim: expandtab:ts=2:sw=2
22

3-
var
3+
const
44
fs = require('fs');
55

66
module.exports.readJsonConfig = function readJsonConfig(path) {
7-
var contents = fs.readFileSync(path);
7+
const contents = fs.readFileSync(path);
88
return JSON.parse(contents);
99
};

0 commit comments

Comments
 (0)