Skip to content

Commit

Permalink
test: remove redundant common import
Browse files Browse the repository at this point in the history
As the test-runner preloads `common` module, importing it in the test
is not necessary unless its properties are used. This commit removes
all such unnecessary imports.
  • Loading branch information
thefourtheye committed Sep 12, 2015
1 parent 2954a3f commit 1151652
Show file tree
Hide file tree
Showing 311 changed files with 13 additions and 320 deletions.
1 change: 0 additions & 1 deletion test/internet/test-dns-txt-sigsegv.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var dns = require('dns');

Expand Down
1 change: 0 additions & 1 deletion test/internet/test-http-dns-fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* should trigger the error event after each attempt.
*/

var common = require('../common');
var assert = require('assert');
var http = require('http');

Expand Down
1 change: 0 additions & 1 deletion test/internet/test-net-connect-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// https://groups.google.com/forum/#!topic/nodejs/UE0ZbfLt6t8
// https://groups.google.com/forum/#!topic/nodejs-dev/jR7-5UDqXkw

var common = require('../common');
var net = require('net');
var assert = require('assert');

Expand Down
1 change: 0 additions & 1 deletion test/internet/test-net-connect-unref.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var net = require('net');

Expand Down
1 change: 0 additions & 1 deletion test/message/2100bytes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var util = require('util');

Expand Down
1 change: 0 additions & 1 deletion test/message/error_exit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

process.on('exit', function(code) {
Expand Down
1 change: 0 additions & 1 deletion test/message/eval_messages.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

var common = require('../common');
var assert = require('assert');

var spawn = require('child_process').spawn;
Expand Down
1 change: 0 additions & 1 deletion test/message/hello_world.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

console.log('hello world');
1 change: 0 additions & 1 deletion test/message/max_tick_depth.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');

process.maxTickDepth = 10;
var i = 20;
Expand Down
1 change: 0 additions & 1 deletion test/message/nexttick_throw.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

process.nextTick(function() {
Expand Down
1 change: 0 additions & 1 deletion test/message/stack_overflow.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

Error.stackTraceLimit = 0;
Expand Down
1 change: 0 additions & 1 deletion test/message/stdin_messages.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

var common = require('../common');
var assert = require('assert');

var spawn = require('child_process').spawn;
Expand Down
1 change: 0 additions & 1 deletion test/message/throw_custom_error.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

// custom error throwing
Expand Down
2 changes: 1 addition & 1 deletion test/message/throw_custom_error.out
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion test/message/throw_in_line_with_tabs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable indent */
'use strict';
var common = require('../common');
var assert = require('assert');

console.error('before');
Expand Down
2 changes: 1 addition & 1 deletion test/message/throw_in_line_with_tabs.out
Original file line number Diff line number Diff line change
@@ -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]
1 change: 0 additions & 1 deletion test/message/throw_non_error.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

// custom error throwing
Expand Down
2 changes: 1 addition & 1 deletion test/message/throw_non_error.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*test*message*throw_non_error.js:6
*test*message*throw_non_error.js:5
throw ({ foo: 'bar' });
^
[object Object]
1 change: 0 additions & 1 deletion test/message/throw_null.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

throw null;
2 changes: 1 addition & 1 deletion test/message/throw_null.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

*test*message*throw_null.js:5
*test*message*throw_null.js:4
throw null;
^
null
1 change: 0 additions & 1 deletion test/message/throw_undefined.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

throw undefined;
2 changes: 1 addition & 1 deletion test/message/throw_undefined.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

*test*message*throw_undefined.js:5
*test*message*throw_undefined.js:4
throw undefined;
^
undefined
1 change: 0 additions & 1 deletion test/message/timeout_throw.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

setTimeout(function() {
Expand Down
1 change: 0 additions & 1 deletion test/message/undefined_reference_in_new_context.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var vm = require('vm');

Expand Down
1 change: 0 additions & 1 deletion test/message/vm_display_runtime_error.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var vm = require('vm');

Expand Down
1 change: 0 additions & 1 deletion test/message/vm_display_syntax_error.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var vm = require('vm');

Expand Down
1 change: 0 additions & 1 deletion test/message/vm_dont_display_runtime_error.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var vm = require('vm');

Expand Down
1 change: 0 additions & 1 deletion test/message/vm_dont_display_syntax_error.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var vm = require('vm');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-buffer-arraybuffer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

const common = require('../common');
const assert = require('assert');

const Buffer = require('buffer').Buffer;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-buffer-ascii.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

// ASCII conversion in node.js simply masks off the high bits,
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-buffer-bytelength.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

var common = require('../common');
var assert = require('assert');
var Buffer = require('buffer').Buffer;

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-buffer-concat.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

var zero = [];
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-buffer-fakes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

const common = require('../common');
const assert = require('assert');
const Buffer = require('buffer').Buffer;
const Bp = Buffer.prototype;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-buffer-indexof.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

var Buffer = require('buffer').Buffer;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-buffer-inspect.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

var util = require('util');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-buffer-iterator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

var buffer = new Buffer([1, 2, 3, 4, 5]);
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-buffer-slow.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

const common = require('../common');
const assert = require('assert');
const buffer = require('buffer');
const Buffer = buffer.Buffer;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-constructor.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

var assert = require('assert');
var common = require('../common');
var child_process = require('child_process');
var ChildProcess = child_process.ChildProcess;
assert.equal(typeof ChildProcess, 'function');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-detached.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var path = require('path');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-fork-and-spawn.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn;
var fork = require('child_process').fork;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-fork-ref.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var fork = require('child_process').fork;

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-fork-ref2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var fork = require('child_process').fork;

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-internal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

//messages
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-set-blocking.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var ch = require('child_process');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-silent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var childProcess = require('child_process');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-spawnsync-env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var cp = require('child_process');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-spawnsync-timeout.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

var spawnSync = require('child_process').spawnSync;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-stdin-ipc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

var spawn = require('child_process').spawn;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-stdio-big-write-end.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var BUFSIZE = 1024;

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-validate-stdio.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Flags: --expose_internals

var assert = require('assert');
var common = require('../common');
var _validateStdio = require('internal/child_process')._validateStdio;

// should throw if string and not ignore, pipe, or inherit
Expand Down
3 changes: 1 addition & 2 deletions test/parallel/test-cli-eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ if (module.parent) {
process.exit(42);
}

var common = require('../common'),
assert = require('assert'),
var assert = require('assert'),
child = require('child_process'),
nodejs = '"' + process.execPath + '"';

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-cluster-debug-port.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const cluster = require('cluster');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-cluster-fork-env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var cluster = require('cluster');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-cluster-net-listen.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var cluster = require('cluster');
var net = require('net');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-cluster-setup-master-argv.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var cluster = require('cluster');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-cluster-setup-master-cumulative.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var cluster = require('cluster');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-cluster-setup-master-emit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var cluster = require('cluster');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-cluster-setup-master-multiple.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var cluster = require('cluster');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-cluster-setup-master.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var cluster = require('cluster');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-cluster-uncaught-exception.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// one that the cluster module installs.
// https://github.com/joyent/node/issues/2556

var common = require('../common');
var assert = require('assert');
var cluster = require('cluster');
var fork = require('child_process').fork;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-cluster-worker-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// test-cluster-worker-constructor.js
// validates correct behavior of the cluster.Worker constructor

var common = require('../common');
var assert = require('assert');
var cluster = require('cluster');
var worker;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-cluster-worker-death.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var cluster = require('cluster');

Expand Down
Loading

0 comments on commit 1151652

Please sign in to comment.