diff --git a/test/addons/buffer-free-callback/test.js b/test/addons/buffer-free-callback/test.js index 6ee328d522..a70931d81e 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 930b706f97..03aca7a662 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 7d3444c236..bb1569601c 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 dfcba71bdd..187bbd2cfc 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 474531a016..22f61a36f9 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 edcbe3b2d6..cef53bfb3d 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 4f87626f63..6e1ced4124 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 9466ed9e8b..8866ca8514 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 ef73c52c88..401581f31d 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 54dcd9f3a6..3bb403feb3 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 e83b057684..d245cca494 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 2fb82ee053..d4dae642af 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 15f95fcc11..b98edc46ae 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 c252fba1ec..9b17aa68f1 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 eb3eeb1294..5d2c677240 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 da2ae18c44..18c27dbac8 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 c23dac051f..32a71f0486 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 648f874b7e..5c345ac8c0 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 4230ce6529..73821ae53d 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 3525ab4d03..a7ca990744 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 179263478b..23525c14d8 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 6b4c824cbe..19d0120a90 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 bff23e533d..bff0433a14 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 0253cafcf4..6426e1c224 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 474e4d69f2..95d121df87 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 f315aed1a9..2bc4ce5433 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 ba6faa62d8..66cdbb92ac 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 11f3d38d2e..a8ab4339d8 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 6f4d03ca5a..e30d3b21f3 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 0a3c7a609a..adc8478bee 100644 --- a/test/parallel/test-repl-domain.js +++ b/test/parallel/test-repl-domain.js @@ -1,11 +1,10 @@ 'use strict'; -var assert = require('assert'); var common = require('../common'); 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 198fa6a8c5..0376082262 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 b38f57a4ff..332930c813 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 3ca0782ea0..d046c5ea55 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 97b2c0734f..b42053db3b 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 081688cfa5..c9ca3eafd6 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 8c1864f1a7..dcc50a5171 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 a716c6ed64..8f26d28816 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 2586aec59b..ead7de9e28 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 08132e3c75..d1be5311db 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 7abdd38cf2..18223885d6 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 a8a26b4e06..20ca75c793 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 0889a38ed3..c7daaa6b08 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;