Skip to content

Commit ff1efa6

Browse files
committed
test: use const for all require() calls
PR-URL: #10550 Reviewed-By: Rich Trott <[email protected]>
1 parent 1605a2e commit ff1efa6

File tree

605 files changed

+1573
-1552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

605 files changed

+1573
-1552
lines changed

test/addons/async-hello-world/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
const common = require('../../common');
3-
var assert = require('assert');
3+
const assert = require('assert');
44
const binding = require(`./build/${common.buildType}/binding`);
55

66
binding(5, common.mustCall(function(err, val) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
const common = require('../../common');
3-
var assert = require('assert');
3+
const assert = require('assert');
44
const binding = require(`./build/${common.buildType}/binding`);
55
assert.strictEqual(binding(), 'world');
66
console.log('binding.hello() =', binding());

test/addons/hello-world/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
const common = require('../../common');
3-
var assert = require('assert');
3+
const assert = require('assert');
44
const binding = require(`./build/${common.buildType}/binding`);
55
assert.strictEqual(binding.hello(), 'world');
66
console.log('binding.hello() =', binding.hello());

test/addons/load-long-path/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ var contents = fs.readFileSync(addonPath);
3232
fs.writeFileSync(addonDestinationPath, contents);
3333

3434
// Attempt to load at long path destination
35-
var addon = require(addonDestinationPath);
35+
const addon = require(addonDestinationPath);
3636
assert.notEqual(addon, null);
3737
assert.strictEqual(addon.hello(), 'world');

test/addons/repl-domain-abort/test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
2-
var common = require('../../common');
3-
var assert = require('assert');
4-
var repl = require('repl');
5-
var stream = require('stream');
6-
var path = require('path');
2+
const common = require('../../common');
3+
const assert = require('assert');
4+
const repl = require('repl');
5+
const stream = require('stream');
6+
const path = require('path');
77
var buildType = process.config.target_defaults.default_configuration;
88
var buildPath = path.join(__dirname, 'build', buildType, 'binding');
99
// On Windows, escape backslashes in the path before passing it to REPL.

test/debugger/helper-debugger-repl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const common = require('../common');
3-
var assert = require('assert');
4-
var spawn = require('child_process').spawn;
3+
const assert = require('assert');
4+
const spawn = require('child_process').spawn;
55

66
process.env.NODE_DEBUGGER_TIMEOUT = 2000;
77
var port = common.PORT;

test/debugger/test-debugger-repl-break-in-module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
require('../common');
3-
var repl = require('./helper-debugger-repl.js');
3+
const repl = require('./helper-debugger-repl.js');
44

55
repl.startDebugger('break-in-module/main.js');
66

test/debugger/test-debugger-repl-restart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
require('../common');
3-
var repl = require('./helper-debugger-repl.js');
3+
const repl = require('./helper-debugger-repl.js');
44

55
repl.startDebugger('breakpoints.js');
66
var linesWithBreakpoint = [

test/debugger/test-debugger-repl-term.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require('../common');
33
process.env.NODE_FORCE_READLINE = 1;
44

5-
var repl = require('./helper-debugger-repl.js');
5+
const repl = require('./helper-debugger-repl.js');
66

77
repl.startDebugger('breakpoints.js');
88

test/debugger/test-debugger-repl-utf8.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
var common = require('../common');
2+
const common = require('../common');
33
var script = common.fixturesDir + '/breakpoints_utf8.js';
44
process.env.NODE_DEBUGGER_TEST_SCRIPT = script;
55

0 commit comments

Comments
 (0)