Browse Source

test: remove unused modules

Many tests use require() to import modules that subsequently never gets
used. This removes those imports and, in a few cases, removes other
unused variables from tests.

PR-URL: https://github.com/nodejs/node/pull/4475
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
process-exit-stdio-flushing
Rich Trott 9 years ago
parent
commit
6abd8b587e
  1. 2
      test/addons/at-exit/test.js
  2. 2
      test/internet/test-dns-ipv4.js
  3. 2
      test/internet/test-dns-ipv6.js
  4. 1
      test/message/2100bytes.js
  5. 1
      test/parallel/test-cluster-eaddrinuse.js
  6. 1
      test/parallel/test-cluster-worker-forced-exit.js
  7. 1
      test/parallel/test-crypto-certificate.js
  8. 2
      test/parallel/test-dgram-send-callback-buffer-length.js
  9. 3
      test/parallel/test-dgram-udp4.js
  10. 1
      test/parallel/test-domain-multi.js
  11. 2
      test/parallel/test-eval-require.js
  12. 1
      test/parallel/test-event-emitter-listeners-side-effects.js
  13. 1
      test/parallel/test-fs-readdir.js
  14. 1
      test/parallel/test-listen-fd-cluster.js
  15. 1
      test/parallel/test-listen-fd-server.js
  16. 3
      test/parallel/test-readline-keys.js
  17. 1
      test/parallel/test-tick-processor.js
  18. 6
      test/parallel/test-tls-legacy-onselect.js
  19. 1
      test/parallel/test-zlib-dictionary.js
  20. 1
      test/parallel/test-zlib-flush-drain.js
  21. 1
      test/parallel/test-zlib-write-after-flush.js
  22. 3
      test/pummel/test-dtrace-jsstack.js
  23. 1
      test/pummel/test-http-client-reconnect-bug.js
  24. 1
      test/pummel/test-keep-alive.js
  25. 3
      test/pummel/test-timer-wrap2.js
  26. 4
      test/pummel/test-tls-securepair-client.js
  27. 1
      test/sequential/test-child-process-execsync.js
  28. 3
      test/sequential/test-regress-GH-1697.js
  29. 1
      test/sequential/test-stdout-close-catch.js

2
test/addons/at-exit/test.js

@ -1,3 +1,3 @@
'use strict';
require('../../common');
var binding = require('./build/Release/binding');
require('./build/Release/binding');

2
test/internet/test-dns-ipv4.js

@ -3,9 +3,7 @@ var common = require('../common');
var assert = require('assert'),
dns = require('dns'),
net = require('net'),
isIP = net.isIP,
isIPv4 = net.isIPv4;
var util = require('util');
var expected = 0,
completed = 0,

2
test/internet/test-dns-ipv6.js

@ -3,9 +3,7 @@ var common = require('../common');
var assert = require('assert'),
dns = require('dns'),
net = require('net'),
isIP = net.isIP,
isIPv6 = net.isIPv6;
var util = require('util');
var expected = 0,
completed = 0,

1
test/message/2100bytes.js

@ -1,6 +1,5 @@
'use strict';
require('../common');
var util = require('util');
console.log([
'_______________________________________________50',

1
test/parallel/test-cluster-eaddrinuse.js

@ -5,7 +5,6 @@
var common = require('../common');
var assert = require('assert');
var cluster = require('cluster');
var fork = require('child_process').fork;
var net = require('net');

1
test/parallel/test-cluster-worker-forced-exit.js

@ -2,7 +2,6 @@
require('../common');
var assert = require('assert');
var cluster = require('cluster');
var net = require('net');
var SENTINEL = 42;

1
test/parallel/test-crypto-certificate.js

@ -11,7 +11,6 @@ var crypto = require('crypto');
crypto.DEFAULT_ENCODING = 'buffer';
var fs = require('fs');
var path = require('path');
// Test Certificates
var spkacValid = fs.readFileSync(common.fixturesDir + '/spkac.valid');

2
test/parallel/test-dgram-send-callback-buffer-length.js

@ -2,9 +2,7 @@
var common = require('../common');
var assert = require('assert');
var fs = require('fs');
var dgram = require('dgram');
var callbacks = 0;
var client, timer, buf, len, offset;

3
test/parallel/test-dgram-udp4.js

@ -2,8 +2,7 @@
var common = require('../common');
var assert = require('assert');
var fs = require('fs'),
dgram = require('dgram'), server, client,
var dgram = require('dgram'), server, client,
server_port = common.PORT,
message_to_send = 'A message to send',
timer;

1
test/parallel/test-domain-multi.js

@ -4,7 +4,6 @@
var common = require('../common');
var assert = require('assert');
var domain = require('domain');
var events = require('events');
var caughtA = false;
var caughtB = false;

2
test/parallel/test-eval-require.js

@ -2,8 +2,6 @@
var common = require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn;
var path = require('path');
var fs = require('fs');
var options = {
cwd: common.fixturesDir

1
test/parallel/test-event-emitter-listeners-side-effects.js

@ -2,7 +2,6 @@
require('../common');
var assert = require('assert');
var events = require('events');
var EventEmitter = require('events').EventEmitter;
var assert = require('assert');

1
test/parallel/test-fs-readdir.js

@ -2,7 +2,6 @@
const common = require('../common');
const assert = require('assert');
const path = require('path');
const fs = require('fs');
const readdirDir = common.tmpDir;

1
test/parallel/test-listen-fd-cluster.js

@ -4,7 +4,6 @@ var assert = require('assert');
var http = require('http');
var net = require('net');
var PORT = common.PORT;
var spawn = require('child_process').spawn;
var cluster = require('cluster');
console.error('Cluster listen fd test', process.argv[2] || 'runner');

1
test/parallel/test-listen-fd-server.js

@ -4,7 +4,6 @@ var assert = require('assert');
var http = require('http');
var net = require('net');
var PORT = common.PORT;
var spawn = require('child_process').spawn;
if (common.isWindows) {
console.log('1..0 # Skipped: This test is disabled on windows.');

3
test/parallel/test-readline-keys.js

@ -1,6 +1,5 @@
'use strict';
require('../common');
var EventEmitter = require('events').EventEmitter;
var PassThrough = require('stream').PassThrough;
var assert = require('assert');
var inherits = require('util').inherits;
@ -16,7 +15,7 @@ inherits(FakeInput, PassThrough);
var fi = new FakeInput();
var fo = new FakeInput();
var rli = new Interface({ input: fi, output: fo, terminal: true });
new Interface({ input: fi, output: fo, terminal: true });
var keys = [];
fi.on('keypress', function(s, k) {

1
test/parallel/test-tick-processor.js

@ -1,7 +1,6 @@
'use strict';
var fs = require('fs');
var assert = require('assert');
var path = require('path');
var cp = require('child_process');
var common = require('../common');

6
test/parallel/test-tls-legacy-onselect.js

@ -9,14 +9,8 @@ if (!common.hasCrypto) {
var tls = require('tls');
var net = require('net');
var fs = require('fs');
var success = false;
function filenamePEM(n) {
return require('path').join(common.fixturesDir, 'keys', n + '.pem');
}
var server = net.Server(function(raw) {
var pair = tls.createSecurePair(null, true, false, false);
pair.on('error', function() {});

1
test/parallel/test-zlib-dictionary.js

@ -4,7 +4,6 @@
require('../common');
const assert = require('assert');
const zlib = require('zlib');
const path = require('path');
const spdyDict = new Buffer([
'optionsgetheadpostputdeletetraceacceptaccept-charsetaccept-encodingaccept-',

1
test/parallel/test-zlib-flush-drain.js

@ -2,7 +2,6 @@
require('../common');
const assert = require('assert');
const zlib = require('zlib');
const path = require('path');
const bigData = new Buffer(10240).fill('x');

1
test/parallel/test-zlib-write-after-flush.js

@ -2,7 +2,6 @@
require('../common');
var assert = require('assert');
var zlib = require('zlib');
var fs = require('fs');
var gzip = zlib.createGzip();
var gunz = zlib.createUnzip();

3
test/pummel/test-dtrace-jsstack.js

@ -2,7 +2,6 @@
require('../common');
var assert = require('assert');
var os = require('os');
var util = require('util');
if (os.type() != 'SunOS') {
console.log('1..0 # Skipped: no DTRACE support');
@ -13,7 +12,6 @@ if (os.type() != 'SunOS') {
* Some functions to create a recognizable stack.
*/
var frames = [ 'stalloogle', 'bagnoogle', 'doogle' ];
var expected;
var stalloogle = function(str) {
expected = str;
@ -35,7 +33,6 @@ var doogle = function() {
var spawn = require('child_process').spawn;
var prefix = '/var/tmp/node';
var corefile = prefix + '.' + process.pid;
/*
* We're going to use DTrace to stop us, gcore us, and set us running again

1
test/pummel/test-http-client-reconnect-bug.js

@ -3,7 +3,6 @@ var common = require('../common');
var assert = require('assert');
var net = require('net'),
util = require('util'),
http = require('http');
var errorCount = 0;

1
test/pummel/test-keep-alive.js

@ -5,7 +5,6 @@ var common = require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn;
var http = require('http');
var path = require('path');
var url = require('url');
if (common.isWindows) {

3
test/pummel/test-timer-wrap2.js

@ -1,9 +1,8 @@
'use strict';
require('../common');
var assert = require('assert');
// Test that allocating a timer does not increase the loop's reference
// count.
var Timer = process.binding('timer_wrap').Timer;
var t = new Timer();
new Timer();

4
test/pummel/test-tls-securepair-client.js

@ -17,9 +17,7 @@ var join = require('path').join;
var net = require('net');
var assert = require('assert');
var fs = require('fs');
var crypto = require('crypto');
var tls = require('tls');
var exec = require('child_process').exec;
var spawn = require('child_process').spawn;
test1();
@ -47,8 +45,6 @@ function test(keyfn, certfn, check, next) {
// EADDRINUSE.
var PORT = common.PORT + 5;
var connections = 0;
keyfn = join(common.fixturesDir, keyfn);
var key = fs.readFileSync(keyfn).toString();

1
test/sequential/test-child-process-execsync.js

@ -1,7 +1,6 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var os = require('os');
var execSync = require('child_process').execSync;
var execFileSync = require('child_process').execFileSync;

3
test/sequential/test-regress-GH-1697.js

@ -1,8 +1,7 @@
'use strict';
var common = require('../common');
var net = require('net'),
cp = require('child_process'),
util = require('util');
cp = require('child_process');
if (process.argv[2] === 'server') {
// Server

1
test/sequential/test-stdout-close-catch.js

@ -3,7 +3,6 @@ var common = require('../common');
var assert = require('assert');
var path = require('path');
var child_process = require('child_process');
var fs = require('fs');
var testScript = path.join(common.fixturesDir, 'catch-stdout-error.js');

Loading…
Cancel
Save