diff --git a/test/addons/buffer-free-callback/test.js b/test/addons/buffer-free-callback/test.js index 6ee328d5222049..a70931d81e8977 100644 --- a/test/addons/buffer-free-callback/test.js +++ b/test/addons/buffer-free-callback/test.js @@ -2,7 +2,6 @@ // Flags: --expose-gc require('../../common'); -var assert = require('assert'); var binding = require('./build/Release/binding'); function check(size) { diff --git a/test/message/2100bytes.js b/test/message/2100bytes.js index 930b706f977671..03aca7a6626bce 100644 --- a/test/message/2100bytes.js +++ b/test/message/2100bytes.js @@ -1,6 +1,5 @@ 'use strict'; require('../common'); -var assert = require('assert'); var util = require('util'); console.log([ diff --git a/test/message/eval_messages.js b/test/message/eval_messages.js index 7d3444c236b68e..bb1569601c889f 100644 --- a/test/message/eval_messages.js +++ b/test/message/eval_messages.js @@ -1,7 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/message/hello_world.js b/test/message/hello_world.js index dfcba71bdd4334..187bbd2cfcf7f7 100644 --- a/test/message/hello_world.js +++ b/test/message/hello_world.js @@ -1,5 +1,4 @@ 'use strict'; require('../common'); -var assert = require('assert'); console.log('hello world'); diff --git a/test/message/nexttick_throw.js b/test/message/nexttick_throw.js index 474531a0160875..22f61a36f947df 100644 --- a/test/message/nexttick_throw.js +++ b/test/message/nexttick_throw.js @@ -1,6 +1,5 @@ 'use strict'; require('../common'); -var assert = require('assert'); process.nextTick(function() { process.nextTick(function() { diff --git a/test/message/stack_overflow.js b/test/message/stack_overflow.js index edcbe3b2d6fa28..cef53bfb3d35c5 100644 --- a/test/message/stack_overflow.js +++ b/test/message/stack_overflow.js @@ -1,6 +1,5 @@ 'use strict'; require('../common'); -var assert = require('assert'); Error.stackTraceLimit = 0; diff --git a/test/message/stdin_messages.js b/test/message/stdin_messages.js index 4f87626f63cee6..6e1ced4124f2a6 100644 --- a/test/message/stdin_messages.js +++ b/test/message/stdin_messages.js @@ -1,7 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/message/throw_custom_error.js b/test/message/throw_custom_error.js index 9466ed9e8b4747..8866ca8514de7d 100644 --- a/test/message/throw_custom_error.js +++ b/test/message/throw_custom_error.js @@ -1,6 +1,5 @@ 'use strict'; require('../common'); -var assert = require('assert'); // custom error throwing throw ({ name: 'MyCustomError', message: 'This is a custom message' }); diff --git a/test/message/throw_custom_error.out b/test/message/throw_custom_error.out index ef73c52c889dff..401581f31d5caf 100644 --- a/test/message/throw_custom_error.out +++ b/test/message/throw_custom_error.out @@ -1,4 +1,4 @@ -*test*message*throw_custom_error.js:6 +*test*message*throw_custom_error.js:5 throw ({ name: 'MyCustomError', message: 'This is a custom message' }); ^ MyCustomError: This is a custom message diff --git a/test/message/throw_in_line_with_tabs.js b/test/message/throw_in_line_with_tabs.js index 54dcd9f3a64c3b..3bb403feb3221b 100644 --- a/test/message/throw_in_line_with_tabs.js +++ b/test/message/throw_in_line_with_tabs.js @@ -1,7 +1,6 @@ /* eslint-disable indent */ 'use strict'; require('../common'); -var assert = require('assert'); console.error('before'); diff --git a/test/message/throw_in_line_with_tabs.out b/test/message/throw_in_line_with_tabs.out index e83b05768433b8..d245cca4941ab5 100644 --- a/test/message/throw_in_line_with_tabs.out +++ b/test/message/throw_in_line_with_tabs.out @@ -1,5 +1,5 @@ before -*test*message*throw_in_line_with_tabs.js:10 +*test*message*throw_in_line_with_tabs.js:9 throw ({ foo: 'bar' }); ^ [object Object] diff --git a/test/message/throw_non_error.js b/test/message/throw_non_error.js index 2fb82ee053d55a..d4dae642af882b 100644 --- a/test/message/throw_non_error.js +++ b/test/message/throw_non_error.js @@ -1,6 +1,5 @@ 'use strict'; require('../common'); -var assert = require('assert'); // custom error throwing throw ({ foo: 'bar' }); diff --git a/test/message/throw_non_error.out b/test/message/throw_non_error.out index 15f95fcc11699a..b98edc46ae2a6e 100644 --- a/test/message/throw_non_error.out +++ b/test/message/throw_non_error.out @@ -1,4 +1,4 @@ -*test*message*throw_non_error.js:6 +*test*message*throw_non_error.js:5 throw ({ foo: 'bar' }); ^ [object Object] diff --git a/test/message/throw_null.js b/test/message/throw_null.js index c252fba1ecfbb6..9b17aa68f186e4 100644 --- a/test/message/throw_null.js +++ b/test/message/throw_null.js @@ -1,5 +1,4 @@ 'use strict'; require('../common'); -var assert = require('assert'); throw null; diff --git a/test/message/throw_null.out b/test/message/throw_null.out index eb3eeb1294e727..5d2c677240d1a7 100644 --- a/test/message/throw_null.out +++ b/test/message/throw_null.out @@ -1,5 +1,5 @@ -*test*message*throw_null.js:5 +*test*message*throw_null.js:4 throw null; ^ null diff --git a/test/message/throw_undefined.js b/test/message/throw_undefined.js index da2ae18c444d82..18c27dbac87799 100644 --- a/test/message/throw_undefined.js +++ b/test/message/throw_undefined.js @@ -1,5 +1,4 @@ 'use strict'; require('../common'); -var assert = require('assert'); throw undefined; diff --git a/test/message/throw_undefined.out b/test/message/throw_undefined.out index c23dac051fa5f1..32a71f0486e47e 100644 --- a/test/message/throw_undefined.out +++ b/test/message/throw_undefined.out @@ -1,5 +1,5 @@ -*test*message*throw_undefined.js:5 +*test*message*throw_undefined.js:4 throw undefined; ^ undefined diff --git a/test/message/timeout_throw.js b/test/message/timeout_throw.js index 648f874b7e15c4..5c345ac8c0c376 100644 --- a/test/message/timeout_throw.js +++ b/test/message/timeout_throw.js @@ -1,6 +1,5 @@ 'use strict'; require('../common'); -var assert = require('assert'); setTimeout(function() { undefined_reference_error_maker; diff --git a/test/message/undefined_reference_in_new_context.js b/test/message/undefined_reference_in_new_context.js index 4230ce6529336c..73821ae53d4f5f 100644 --- a/test/message/undefined_reference_in_new_context.js +++ b/test/message/undefined_reference_in_new_context.js @@ -1,6 +1,5 @@ 'use strict'; require('../common'); -var assert = require('assert'); var vm = require('vm'); console.error('before'); diff --git a/test/message/vm_display_runtime_error.js b/test/message/vm_display_runtime_error.js index 3525ab4d03073f..a7ca9907444181 100644 --- a/test/message/vm_display_runtime_error.js +++ b/test/message/vm_display_runtime_error.js @@ -1,6 +1,5 @@ 'use strict'; require('../common'); -var assert = require('assert'); var vm = require('vm'); console.error('beginning'); diff --git a/test/message/vm_display_syntax_error.js b/test/message/vm_display_syntax_error.js index 179263478b84b8..23525c14d822fb 100644 --- a/test/message/vm_display_syntax_error.js +++ b/test/message/vm_display_syntax_error.js @@ -1,6 +1,5 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +require('../common'); var vm = require('vm'); console.error('beginning'); diff --git a/test/message/vm_dont_display_runtime_error.js b/test/message/vm_dont_display_runtime_error.js index 6b4c824cbe5eff..19d0120a90abfd 100644 --- a/test/message/vm_dont_display_runtime_error.js +++ b/test/message/vm_dont_display_runtime_error.js @@ -1,6 +1,5 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +require('../common'); var vm = require('vm'); console.error('beginning'); diff --git a/test/message/vm_dont_display_syntax_error.js b/test/message/vm_dont_display_syntax_error.js index bff23e533dcfed..bff0433a144b09 100644 --- a/test/message/vm_dont_display_syntax_error.js +++ b/test/message/vm_dont_display_syntax_error.js @@ -1,6 +1,5 @@ 'use strict'; require('../common'); -var assert = require('assert'); var vm = require('vm'); console.error('beginning'); diff --git a/test/parallel/test-cluster-dgram-2.js b/test/parallel/test-cluster-dgram-2.js index 0253cafcf49766..6426e1c224beb7 100644 --- a/test/parallel/test-cluster-dgram-2.js +++ b/test/parallel/test-cluster-dgram-2.js @@ -2,7 +2,6 @@ var NUM_WORKERS = 4; var PACKETS_PER_WORKER = 10; -var assert = require('assert'); var cluster = require('cluster'); var common = require('../common'); var dgram = require('dgram'); diff --git a/test/parallel/test-cluster-rr-ref.js b/test/parallel/test-cluster-rr-ref.js index 474e4d69f225c6..95d121df875bb8 100644 --- a/test/parallel/test-cluster-rr-ref.js +++ b/test/parallel/test-cluster-rr-ref.js @@ -1,7 +1,6 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); const cluster = require('cluster'); const net = require('net'); diff --git a/test/parallel/test-crypto-verify-failure.js b/test/parallel/test-crypto-verify-failure.js index f315aed1a9f139..2bc4ce5433739d 100644 --- a/test/parallel/test-crypto-verify-failure.js +++ b/test/parallel/test-crypto-verify-failure.js @@ -1,6 +1,5 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); if (!common.hasCrypto) { console.log('1..0 # Skipped: missing crypto'); @@ -20,8 +19,6 @@ var options = { cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') }; -var canSend = true; - var server = tls.Server(options, function(socket) { setImmediate(function() { console.log('sending'); @@ -32,17 +29,15 @@ var server = tls.Server(options, function(socket) { }); }); -var client; - function verify() { console.log('verify'); - var verified = crypto.createVerify('RSA-SHA1') - .update('Test') - .verify(certPem, 'asdfasdfas', 'base64'); + crypto.createVerify('RSA-SHA1') + .update('Test') + .verify(certPem, 'asdfasdfas', 'base64'); } server.listen(common.PORT, function() { - client = tls.connect({ + tls.connect({ port: common.PORT, rejectUnauthorized: false }, function() { diff --git a/test/parallel/test-dgram-empty-packet.js b/test/parallel/test-dgram-empty-packet.js index ba6faa62d86cec..66cdbb92ac8f1b 100644 --- a/test/parallel/test-dgram-empty-packet.js +++ b/test/parallel/test-dgram-empty-packet.js @@ -1,8 +1,6 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); var dgram = require('dgram'); var callbacks = 0; var client; diff --git a/test/parallel/test-dgram-send-empty-buffer.js b/test/parallel/test-dgram-send-empty-buffer.js index 11f3d38d2ed046..a8ab4339d8a398 100644 --- a/test/parallel/test-dgram-send-empty-buffer.js +++ b/test/parallel/test-dgram-send-empty-buffer.js @@ -1,10 +1,7 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); var dgram = require('dgram'); -var callbacks = 0; var client, timer, buf; if (process.platform === 'darwin') { diff --git a/test/parallel/test-domain-stack.js b/test/parallel/test-domain-stack.js index 6f4d03ca5a5e1f..e30d3b21f3af57 100644 --- a/test/parallel/test-domain-stack.js +++ b/test/parallel/test-domain-stack.js @@ -2,9 +2,7 @@ // Make sure that the domain stack doesn't get out of hand. require('../common'); -var assert = require('assert'); var domain = require('domain'); -var events = require('events'); var a = domain.create(); a.name = 'a'; diff --git a/test/parallel/test-repl-domain.js b/test/parallel/test-repl-domain.js index baf0485b3b80b2..1de2405b3ca9a3 100644 --- a/test/parallel/test-repl-domain.js +++ b/test/parallel/test-repl-domain.js @@ -1,12 +1,11 @@ 'use strict'; -var assert = require('assert'); var common = require('../common'); var util = require('util'); var repl = require('repl'); const putIn = new common.ArrayStream(); -var testMe = repl.start('', putIn); +repl.start('', putIn); putIn.write = function(data) { // Don't use assert for this because the domain might catch it, and diff --git a/test/parallel/test-require-extensions-main.js b/test/parallel/test-require-extensions-main.js index 198fa6a8c52d37..0376082262dd78 100644 --- a/test/parallel/test-require-extensions-main.js +++ b/test/parallel/test-require-extensions-main.js @@ -1,5 +1,4 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); require(common.fixturesDir + '/require-bin/bin/req.js'); diff --git a/test/parallel/test-stream-pipe-cleanup-pause.js b/test/parallel/test-stream-pipe-cleanup-pause.js index b38f57a4ff0ba1..332930c813a3dd 100644 --- a/test/parallel/test-stream-pipe-cleanup-pause.js +++ b/test/parallel/test-stream-pipe-cleanup-pause.js @@ -1,6 +1,5 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); const stream = require('stream'); const reader = new stream.Readable(); diff --git a/test/parallel/test-stream2-pipe-error-once-listener.js b/test/parallel/test-stream2-pipe-error-once-listener.js index 3ca0782ea069d4..d046c5ea55e498 100644 --- a/test/parallel/test-stream2-pipe-error-once-listener.js +++ b/test/parallel/test-stream2-pipe-error-once-listener.js @@ -1,6 +1,5 @@ 'use strict'; require('../common'); -var assert = require('assert'); var util = require('util'); var stream = require('stream'); diff --git a/test/parallel/test-timers-non-integer-delay.js b/test/parallel/test-timers-non-integer-delay.js index 97b2c0734f60d5..b42053db3b1895 100644 --- a/test/parallel/test-timers-non-integer-delay.js +++ b/test/parallel/test-timers-non-integer-delay.js @@ -16,7 +16,6 @@ */ require('../common'); -var assert = require('assert'); var TIMEOUT_DELAY = 1.1; var NB_TIMEOUTS_FIRED = 50; diff --git a/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js b/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js index 081688cfa5e812..c9ca3eafd64ebf 100644 --- a/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js +++ b/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js @@ -5,7 +5,6 @@ */ const common = require('../common'); -const assert = require('assert'); const net = require('net'); const clients = []; diff --git a/test/parallel/test-timers-unref-remove-other-unref-timers.js b/test/parallel/test-timers-unref-remove-other-unref-timers.js index 8c1864f1a7da01..dcc50a5171ad28 100644 --- a/test/parallel/test-timers-unref-remove-other-unref-timers.js +++ b/test/parallel/test-timers-unref-remove-other-unref-timers.js @@ -7,7 +7,6 @@ * considered public interface. */ const common = require('../common'); -const assert = require('assert'); const timers = require('timers'); const foo = { diff --git a/test/parallel/test-timers-unrefd-interval-still-fires.js b/test/parallel/test-timers-unrefd-interval-still-fires.js index a716c6ed645cbd..8f26d28816b60c 100644 --- a/test/parallel/test-timers-unrefd-interval-still-fires.js +++ b/test/parallel/test-timers-unrefd-interval-still-fires.js @@ -3,7 +3,6 @@ * This test is a regression test for joyent/node#8900. */ const common = require('../common'); -const assert = require('assert'); const TEST_DURATION = common.platformTimeout(100); const N = 5; diff --git a/test/pummel/test-fs-watch-non-recursive.js b/test/pummel/test-fs-watch-non-recursive.js index 2586aec59b2d94..ead7de9e28dc47 100644 --- a/test/pummel/test-fs-watch-non-recursive.js +++ b/test/pummel/test-fs-watch-non-recursive.js @@ -1,6 +1,5 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); var path = require('path'); var fs = require('fs'); diff --git a/test/pummel/test-http-upload-timeout.js b/test/pummel/test-http-upload-timeout.js index 08132e3c7594d1..d1be5311db0c00 100644 --- a/test/pummel/test-http-upload-timeout.js +++ b/test/pummel/test-http-upload-timeout.js @@ -3,7 +3,6 @@ // data in random intervals. Clients are also randomly disconnecting until there // are no more clients left. If no false timeout occurs, this test has passed. var common = require('../common'), - assert = require('assert'), http = require('http'), server = http.createServer(), connections = 0; diff --git a/test/pummel/test-next-tick-infinite-calls.js b/test/pummel/test-next-tick-infinite-calls.js index 7abdd38cf26e83..18223885d6cc19 100644 --- a/test/pummel/test-next-tick-infinite-calls.js +++ b/test/pummel/test-next-tick-infinite-calls.js @@ -1,6 +1,5 @@ 'use strict'; require('../common'); -var assert = require('assert'); var complete = 0; diff --git a/test/sequential/test-regress-GH-819.js b/test/sequential/test-regress-GH-819.js index a8a26b4e067f64..20ca75c793ce24 100644 --- a/test/sequential/test-regress-GH-819.js +++ b/test/sequential/test-regress-GH-819.js @@ -1,7 +1,6 @@ 'use strict'; require('../common'); var net = require('net'); -var assert = require('assert'); // Connect to something that we need to DNS resolve var c = net.createConnection(80, 'google.com'); diff --git a/test/sequential/test-stream2-stderr-sync.js b/test/sequential/test-stream2-stderr-sync.js index 0889a38ed398db..c7daaa6b083205 100644 --- a/test/sequential/test-stream2-stderr-sync.js +++ b/test/sequential/test-stream2-stderr-sync.js @@ -2,10 +2,6 @@ // Make sure that sync writes to stderr get processed before exiting. require('../common'); -var assert = require('assert'); -var util = require('util'); - -var errnoException = util._errnoException; function parent() { var spawn = require('child_process').spawn;