Browse Source

test: make import common as the first line

The `test/common` module has the capability to identify if any variable
is leaked to the global scope and fail the test. So that has to be
imported at the beginning.

PR-URL: https://github.com/nodejs/node/pull/7786
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
v7.x
Sakthipriyan Vairamani 9 years ago
committed by Rich Trott
parent
commit
612307564b
  1. 4
      test/debugger/helper-debugger-repl.js
  2. 2
      test/debugger/test-debug-break-on-uncaught.js
  3. 4
      test/debugger/test-debugger-client.js
  4. 2
      test/disabled/test-dgram-send-error.js
  5. 3
      test/gc/test-http-client-connaborted.js
  6. 3
      test/gc/test-http-client-onerror.js
  7. 3
      test/gc/test-http-client-timeout.js
  8. 3
      test/gc/test-http-client.js
  9. 3
      test/gc/test-net-timeout.js
  10. 2
      test/parallel/test-child-process-disconnect.js
  11. 2
      test/parallel/test-child-process-flush-stdio.js
  12. 2
      test/parallel/test-child-process-fork-close.js
  13. 2
      test/parallel/test-child-process-fork-dgram.js
  14. 2
      test/parallel/test-child-process-fork-exec-path.js
  15. 2
      test/parallel/test-child-process-fork-net2.js
  16. 2
      test/parallel/test-child-process-spawn-typeerror.js
  17. 3
      test/parallel/test-cli-syntax.js
  18. 2
      test/parallel/test-cluster-dgram-1.js
  19. 2
      test/parallel/test-cluster-dgram-2.js
  20. 2
      test/parallel/test-cluster-worker-no-exit.js
  21. 4
      test/parallel/test-debugger-repeat-last.js
  22. 3
      test/parallel/test-debugger-util-regression.js
  23. 2
      test/parallel/test-domain-with-abort-on-uncaught-exception.js
  24. 4
      test/parallel/test-fs-read-stream-fd.js
  25. 2
      test/parallel/test-fs-readfile-unlink.js
  26. 2
      test/parallel/test-https-client-get-url.js
  27. 3
      test/parallel/test-https-req-split.js
  28. 2
      test/parallel/test-https-strict.js
  29. 2
      test/parallel/test-path-makelong.js
  30. 2
      test/parallel/test-process-env.js
  31. 2
      test/parallel/test-process-no-deprecation.js
  32. 2
      test/parallel/test-regress-GH-1899.js
  33. 2
      test/parallel/test-repl-.save.load.js
  34. 2
      test/parallel/test-repl-timeout-throw.js
  35. 2
      test/parallel/test-setproctitle.js
  36. 2
      test/parallel/test-tick-processor.js
  37. 2
      test/parallel/test-timers-blocking-callback.js
  38. 2
      test/parallel/test-timers-nested.js
  39. 2
      test/parallel/test-tls-client-default-ciphers.js
  40. 2
      test/parallel/test-tls-close-error.js
  41. 3
      test/parallel/test-tls-empty-sni-context.js
  42. 2
      test/parallel/test-tls-handshake-error.js
  43. 2
      test/pummel/test-abort-fatal-error.js
  44. 4
      test/pummel/test-regress-GH-814.js
  45. 2
      test/sequential/test-child-process-fork-getconnections.js
  46. 16
      test/sequential/test-init.js

4
test/debugger/helper-debugger-repl.js

@ -1,9 +1,9 @@
'use strict'; 'use strict';
process.env.NODE_DEBUGGER_TIMEOUT = 2000; const common = require('../common');
var common = require('../common');
var assert = require('assert'); var assert = require('assert');
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;
process.env.NODE_DEBUGGER_TIMEOUT = 2000;
var port = common.PORT; var port = common.PORT;
var child; var child;

2
test/debugger/test-debug-break-on-uncaught.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
const common = require('../common');
const path = require('path'); const path = require('path');
const assert = require('assert'); const assert = require('assert');
const spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
const common = require('../common');
const debug = require('_debugger'); const debug = require('_debugger');
var scenarios = []; var scenarios = [];

4
test/debugger/test-debugger-client.js

@ -1,9 +1,9 @@
'use strict'; 'use strict';
process.env.NODE_DEBUGGER_TIMEOUT = 2000; const common = require('../common');
var common = require('../common');
var assert = require('assert'); var assert = require('assert');
var debug = require('_debugger'); var debug = require('_debugger');
process.env.NODE_DEBUGGER_TIMEOUT = 2000;
var debugPort = common.PORT; var debugPort = common.PORT;
debug.port = debugPort; debug.port = debugPort;
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;

2
test/disabled/test-dgram-send-error.js

@ -7,10 +7,10 @@
// we also send packets to ourselves to verify that after receiving an error // we also send packets to ourselves to verify that after receiving an error
// we can still receive packets successfully. // we can still receive packets successfully.
const common = require('../common');
var ITERATIONS = 1000; var ITERATIONS = 1000;
var assert = require('assert'), var assert = require('assert'),
common = require('../common'),
dgram = require('dgram'); dgram = require('dgram');
var buf = Buffer.alloc(1024, 42); var buf = Buffer.alloc(1024, 42);

3
test/gc/test-http-client-connaborted.js

@ -2,13 +2,14 @@
// just like test/gc/http-client.js, // just like test/gc/http-client.js,
// but aborting every connection that comes in. // but aborting every connection that comes in.
require('../common');
function serverHandler(req, res) { function serverHandler(req, res) {
res.connection.destroy(); res.connection.destroy();
} }
const http = require('http'); const http = require('http');
const weak = require('weak'); const weak = require('weak');
require('../common');
const assert = require('assert'); const assert = require('assert');
const todo = 500; const todo = 500;
let done = 0; let done = 0;

3
test/gc/test-http-client-onerror.js

@ -2,6 +2,8 @@
// just like test/gc/http-client.js, // just like test/gc/http-client.js,
// but with an on('error') handler that does nothing. // but with an on('error') handler that does nothing.
require('../common');
function serverHandler(req, res) { function serverHandler(req, res) {
req.resume(); req.resume();
res.writeHead(200, {'Content-Type': 'text/plain'}); res.writeHead(200, {'Content-Type': 'text/plain'});
@ -10,7 +12,6 @@ function serverHandler(req, res) {
const http = require('http'); const http = require('http');
const weak = require('weak'); const weak = require('weak');
require('../common');
const assert = require('assert'); const assert = require('assert');
const todo = 500; const todo = 500;
let done = 0; let done = 0;

3
test/gc/test-http-client-timeout.js

@ -2,6 +2,8 @@
// just like test/gc/http-client.js, // just like test/gc/http-client.js,
// but with a timeout set // but with a timeout set
require('../common');
function serverHandler(req, res) { function serverHandler(req, res) {
setTimeout(function() { setTimeout(function() {
req.resume(); req.resume();
@ -12,7 +14,6 @@ function serverHandler(req, res) {
const http = require('http'); const http = require('http');
const weak = require('weak'); const weak = require('weak');
require('../common');
const assert = require('assert'); const assert = require('assert');
const todo = 550; const todo = 550;
let done = 0; let done = 0;

3
test/gc/test-http-client.js

@ -1,6 +1,8 @@
'use strict'; 'use strict';
// just a simple http server and client. // just a simple http server and client.
require('../common');
function serverHandler(req, res) { function serverHandler(req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'}); res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n'); res.end('Hello World\n');
@ -8,7 +10,6 @@ function serverHandler(req, res) {
const http = require('http'); const http = require('http');
const weak = require('weak'); const weak = require('weak');
require('../common');
const assert = require('assert'); const assert = require('assert');
const todo = 500; const todo = 500;
let done = 0; let done = 0;

3
test/gc/test-net-timeout.js

@ -2,6 +2,8 @@
// just like test/gc/http-client-timeout.js, // just like test/gc/http-client-timeout.js,
// but using a net server/client instead // but using a net server/client instead
require('../common');
function serverHandler(sock) { function serverHandler(sock) {
sock.setTimeout(120000); sock.setTimeout(120000);
sock.resume(); sock.resume();
@ -19,7 +21,6 @@ function serverHandler(sock) {
const net = require('net'); const net = require('net');
const weak = require('weak'); const weak = require('weak');
require('../common');
const assert = require('assert'); const assert = require('assert');
const todo = 500; const todo = 500;
let done = 0; let done = 0;

2
test/parallel/test-child-process-disconnect.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const common = require('../common');
var assert = require('assert'); var assert = require('assert');
var common = require('../common');
var fork = require('child_process').fork; var fork = require('child_process').fork;
var net = require('net'); var net = require('net');

2
test/parallel/test-child-process-flush-stdio.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const cp = require('child_process');
const common = require('../common'); const common = require('../common');
const cp = require('child_process');
const assert = require('assert'); const assert = require('assert');
// Windows' `echo` command is a built-in shell command and not an external // Windows' `echo` command is a built-in shell command and not an external

2
test/parallel/test-child-process-fork-close.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const assert = require('assert');
const common = require('../common'); const common = require('../common');
const assert = require('assert');
const fork = require('child_process').fork; const fork = require('child_process').fork;
var cp = fork(common.fixturesDir + '/child-process-message-and-exit.js'); var cp = fork(common.fixturesDir + '/child-process-message-and-exit.js');

2
test/parallel/test-child-process-fork-dgram.js

@ -13,10 +13,10 @@
* and the test will fail. * and the test will fail.
*/ */
const common = require('../common');
var dgram = require('dgram'); var dgram = require('dgram');
var fork = require('child_process').fork; var fork = require('child_process').fork;
var assert = require('assert'); var assert = require('assert');
var common = require('../common');
if (common.isWindows) { if (common.isWindows) {
common.skip('Sending dgram sockets to child processes is ' + common.skip('Sending dgram sockets to child processes is ' +

2
test/parallel/test-child-process-fork-exec-path.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
const common = require('../common');
var assert = require('assert'); var assert = require('assert');
var fs = require('fs'); var fs = require('fs');
var path = require('path'); var path = require('path');
var common = require('../common');
var msg = {test: 'this'}; var msg = {test: 'this'};
var nodePath = process.execPath; var nodePath = process.execPath;
var copyPath = path.join(common.tmpDir, 'node-copy.exe'); var copyPath = path.join(common.tmpDir, 'node-copy.exe');

2
test/parallel/test-child-process-fork-net2.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const common = require('../common');
var assert = require('assert'); var assert = require('assert');
var common = require('../common');
var fork = require('child_process').fork; var fork = require('child_process').fork;
var net = require('net'); var net = require('net');
var count = 12; var count = 12;

2
test/parallel/test-child-process-spawn-typeerror.js

@ -1,10 +1,10 @@
'use strict'; 'use strict';
const common = require('../common');
const assert = require('assert'); const assert = require('assert');
const child_process = require('child_process'); const child_process = require('child_process');
const spawn = child_process.spawn; const spawn = child_process.spawn;
const fork = child_process.fork; const fork = child_process.fork;
const execFile = child_process.execFile; const execFile = child_process.execFile;
const common = require('../common');
const cmd = common.isWindows ? 'rundll32' : 'ls'; const cmd = common.isWindows ? 'rundll32' : 'ls';
const invalidcmd = 'hopefully_you_dont_have_this_on_your_machine'; const invalidcmd = 'hopefully_you_dont_have_this_on_your_machine';
const invalidArgsMsg = /Incorrect value of args option/; const invalidArgsMsg = /Incorrect value of args option/;

3
test/parallel/test-cli-syntax.js

@ -1,11 +1,10 @@
'use strict'; 'use strict';
const common = require('../common');
const assert = require('assert'); const assert = require('assert');
const spawnSync = require('child_process').spawnSync; const spawnSync = require('child_process').spawnSync;
const path = require('path'); const path = require('path');
const common = require('../common');
var node = process.execPath; var node = process.execPath;
// test both sets of arguments that check syntax // test both sets of arguments that check syntax

2
test/parallel/test-cluster-dgram-1.js

@ -1,10 +1,10 @@
'use strict'; 'use strict';
const common = require('../common');
var NUM_WORKERS = 4; var NUM_WORKERS = 4;
var PACKETS_PER_WORKER = 10; var PACKETS_PER_WORKER = 10;
var assert = require('assert'); var assert = require('assert');
var cluster = require('cluster'); var cluster = require('cluster');
var common = require('../common');
var dgram = require('dgram'); var dgram = require('dgram');

2
test/parallel/test-cluster-dgram-2.js

@ -1,9 +1,9 @@
'use strict'; 'use strict';
const common = require('../common');
var NUM_WORKERS = 4; var NUM_WORKERS = 4;
var PACKETS_PER_WORKER = 10; var PACKETS_PER_WORKER = 10;
var cluster = require('cluster'); var cluster = require('cluster');
var common = require('../common');
var dgram = require('dgram'); var dgram = require('dgram');

2
test/parallel/test-cluster-worker-no-exit.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
const common = require('../common');
var assert = require('assert'); var assert = require('assert');
var cluster = require('cluster'); var cluster = require('cluster');
var net = require('net'); var net = require('net');
var common = require('../common');
var destroyed; var destroyed;
var success; var success;

4
test/parallel/test-debugger-repeat-last.js

@ -1,10 +1,8 @@
'use strict'; 'use strict';
const common = require('../common');
const path = require('path'); const path = require('path');
const spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
const assert = require('assert'); const assert = require('assert');
const common = require('../common');
const fixture = path.join( const fixture = path.join(
common.fixturesDir, common.fixturesDir,
'debugger-repeat-last.js' 'debugger-repeat-last.js'

3
test/parallel/test-debugger-util-regression.js

@ -1,10 +1,9 @@
'use strict'; 'use strict';
const common = require('../common');
const path = require('path'); const path = require('path');
const spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
const assert = require('assert'); const assert = require('assert');
const common = require('../common');
const fixture = path.join( const fixture = path.join(
common.fixturesDir, common.fixturesDir,
'debugger-util-regression-fixture.js' 'debugger-util-regression-fixture.js'

2
test/parallel/test-domain-with-abort-on-uncaught-exception.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
const common = require('../common');
const assert = require('assert'); const assert = require('assert');
const fs = require('fs'); const fs = require('fs');
const common = require('../common');
/* /*
* The goal of this test is to make sure that: * The goal of this test is to make sure that:

4
test/parallel/test-fs-read-stream-fd.js

@ -1,10 +1,8 @@
'use strict'; 'use strict';
const common = require('../common');
var fs = require('fs'); var fs = require('fs');
var assert = require('assert'); var assert = require('assert');
var path = require('path'); var path = require('path');
var common = require('../common');
var file = path.join(common.tmpDir, '/read_stream_fd_test.txt'); var file = path.join(common.tmpDir, '/read_stream_fd_test.txt');
var input = 'hello world'; var input = 'hello world';
var output = ''; var output = '';

2
test/parallel/test-fs-readfile-unlink.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const assert = require('assert');
const common = require('../common'); const common = require('../common');
const assert = require('assert');
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const dirName = path.resolve(common.fixturesDir, 'test-readfile-unlink'); const dirName = path.resolve(common.fixturesDir, 'test-readfile-unlink');

2
test/parallel/test-https-client-get-url.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
const common = require('../common');
// disable strict server certificate validation by the client // disable strict server certificate validation by the client
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
var common = require('../common');
var assert = require('assert'); var assert = require('assert');
if (!common.hasCrypto) { if (!common.hasCrypto) {

3
test/parallel/test-https-req-split.js

@ -1,9 +1,8 @@
'use strict'; 'use strict';
const common = require('../common');
// disable strict server certificate validation by the client // disable strict server certificate validation by the client
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
var common = require('../common');
if (!common.hasCrypto) { if (!common.hasCrypto) {
common.skip('missing crypto'); common.skip('missing crypto');
return; return;

2
test/parallel/test-https-strict.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
const common = require('../common');
// disable strict server certificate validation by the client // disable strict server certificate validation by the client
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
var common = require('../common');
var assert = require('assert'); var assert = require('assert');
if (!common.hasCrypto) { if (!common.hasCrypto) {

2
test/parallel/test-path-makelong.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const common = require('../common');
var assert = require('assert'); var assert = require('assert');
var path = require('path'); var path = require('path');
var common = require('../common');
if (common.isWindows) { if (common.isWindows) {
var file = path.join(common.fixturesDir, 'a.js'); var file = path.join(common.fixturesDir, 'a.js');

2
test/parallel/test-process-env.js

@ -1,10 +1,10 @@
'use strict'; 'use strict';
/* eslint-disable max-len */ /* eslint-disable max-len */
require('../common');
// first things first, set the timezone; see tzset(3) // first things first, set the timezone; see tzset(3)
process.env.TZ = 'Europe/Amsterdam'; process.env.TZ = 'Europe/Amsterdam';
require('../common');
var assert = require('assert'); var assert = require('assert');
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;

2
test/parallel/test-process-no-deprecation.js

@ -4,9 +4,9 @@
// The --no-warnings flag only supresses writing the warning to stderr, not the // The --no-warnings flag only supresses writing the warning to stderr, not the
// emission of the corresponding event. This test file can be run without it. // emission of the corresponding event. This test file can be run without it.
const common = require('../common');
process.noDeprecation = true; process.noDeprecation = true;
const common = require('../common');
const assert = require('assert'); const assert = require('assert');
function listener() { function listener() {

2
test/parallel/test-regress-GH-1899.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
const common = require('../common');
var path = require('path'); var path = require('path');
var assert = require('assert'); var assert = require('assert');
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;
var common = require('../common');
var child = spawn(process.argv[0], [ var child = spawn(process.argv[0], [
path.join(common.fixturesDir, 'GH-1899-output.js') path.join(common.fixturesDir, 'GH-1899-output.js')

2
test/parallel/test-repl-.save.load.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
const common = require('../common');
var assert = require('assert'); var assert = require('assert');
var join = require('path').join; var join = require('path').join;
var fs = require('fs'); var fs = require('fs');
var common = require('../common');
common.refreshTmpDir(); common.refreshTmpDir();

2
test/parallel/test-repl-timeout-throw.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const common = require('../common');
var assert = require('assert'); var assert = require('assert');
var common = require('../common');
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;

2
test/parallel/test-setproctitle.js

@ -1,13 +1,13 @@
'use strict'; 'use strict';
// Original test written by Jakub Lekstan <kuebzky@gmail.com> // Original test written by Jakub Lekstan <kuebzky@gmail.com>
require('../common');
// FIXME add sunos support // FIXME add sunos support
if ('linux freebsd darwin'.indexOf(process.platform) === -1) { if ('linux freebsd darwin'.indexOf(process.platform) === -1) {
console.log(`1..0 # Skipped: Unsupported platform [${process.platform}]`); console.log(`1..0 # Skipped: Unsupported platform [${process.platform}]`);
return; return;
} }
require('../common');
var assert = require('assert'); var assert = require('assert');
var exec = require('child_process').exec; var exec = require('child_process').exec;
var path = require('path'); var path = require('path');

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

@ -1,8 +1,8 @@
'use strict'; 'use strict';
const common = require('../common');
const fs = require('fs'); const fs = require('fs');
const assert = require('assert'); const assert = require('assert');
const cp = require('child_process'); const cp = require('child_process');
const common = require('../common');
// TODO(mhdawson) Currently the test-tick-processor functionality in V8 // TODO(mhdawson) Currently the test-tick-processor functionality in V8
// depends on addresses being smaller than a full 64 bits. Aix supports // depends on addresses being smaller than a full 64 bits. Aix supports

2
test/parallel/test-timers-blocking-callback.js

@ -22,8 +22,8 @@
* is not empty (see testAddingTimerToNonEmptyTimersList). * is not empty (see testAddingTimerToNonEmptyTimersList).
*/ */
const assert = require('assert');
const common = require('../common'); const common = require('../common');
const assert = require('assert');
const Timer = process.binding('timer_wrap').Timer; const Timer = process.binding('timer_wrap').Timer;
const TIMEOUT = 100; const TIMEOUT = 100;

2
test/parallel/test-timers-nested.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const assert = require('assert');
const common = require('../common'); const common = require('../common');
const assert = require('assert');
// Make sure we test 0ms timers, since they would had always wanted to run on // Make sure we test 0ms timers, since they would had always wanted to run on
// the current tick, and greater than 0ms timers, for scenarios where the // the current tick, and greater than 0ms timers, for scenarios where the

2
test/parallel/test-tls-client-default-ciphers.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const common = require('../common');
var assert = require('assert'); var assert = require('assert');
var common = require('../common');
if (!common.hasCrypto) { if (!common.hasCrypto) {
common.skip('missing crypto'); common.skip('missing crypto');

2
test/parallel/test-tls-close-error.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const common = require('../common');
var assert = require('assert'); var assert = require('assert');
var common = require('../common');
if (!common.hasCrypto) { if (!common.hasCrypto) {
common.skip('missing crypto'); common.skip('missing crypto');

3
test/parallel/test-tls-empty-sni-context.js

@ -1,12 +1,13 @@
'use strict'; 'use strict';
const common = require('../common');
if (!process.features.tls_sni) { if (!process.features.tls_sni) {
console.log('1..0 # Skipped: node compiled without OpenSSL or ' + console.log('1..0 # Skipped: node compiled without OpenSSL or ' +
'with old OpenSSL version.'); 'with old OpenSSL version.');
return; return;
} }
const common = require('../common');
const assert = require('assert'); const assert = require('assert');
if (!common.hasCrypto) { if (!common.hasCrypto) {

2
test/parallel/test-tls-handshake-error.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const common = require('../common');
var assert = require('assert'); var assert = require('assert');
var common = require('../common');
if (!common.hasCrypto) { if (!common.hasCrypto) {
common.skip('missing crypto'); common.skip('missing crypto');

2
test/pummel/test-abort-fatal-error.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const common = require('../common');
var assert = require('assert'); var assert = require('assert');
var common = require('../common');
if (common.isWindows) { if (common.isWindows) {
common.skip('no RLIMIT_NOFILE on Windows'); common.skip('no RLIMIT_NOFILE on Windows');

4
test/pummel/test-regress-GH-814.js

@ -1,6 +1,8 @@
'use strict'; 'use strict';
// Flags: --expose_gc // Flags: --expose_gc
const common = require('../common');
function newBuffer(size, value) { function newBuffer(size, value) {
var buffer = Buffer.allocUnsafe(size); var buffer = Buffer.allocUnsafe(size);
while (size--) { while (size--) {
@ -11,8 +13,6 @@ function newBuffer(size, value) {
return buffer; return buffer;
} }
var common = require('../common');
var fs = require('fs'); var fs = require('fs');
var testFileName = require('path').join(common.tmpDir, 'GH-814_testFile.txt'); var testFileName = require('path').join(common.tmpDir, 'GH-814_testFile.txt');
var testFileFD = fs.openSync(testFileName, 'w'); var testFileFD = fs.openSync(testFileName, 'w');

2
test/sequential/test-child-process-fork-getconnections.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const assert = require('assert');
const common = require('../common'); const common = require('../common');
const assert = require('assert');
const fork = require('child_process').fork; const fork = require('child_process').fork;
const net = require('net'); const net = require('net');
const count = 12; const count = 12;

16
test/sequential/test-init.js

@ -1,12 +1,11 @@
'use strict'; 'use strict';
(function() { const common = require('../common');
const assert = require('assert'); const assert = require('assert');
const child = require('child_process'); const child = require('child_process');
const util = require('util'); const util = require('util');
const common = require('../common'); if (process.env['TEST_INIT']) {
if (process.env['TEST_INIT']) {
util.print('Loaded successfully!'); util.print('Loaded successfully!');
} else { } else {
// change CWD as we do this test so its not dependant on current CWD // change CWD as we do this test so its not dependant on current CWD
// being in the test folder // being in the test folder
process.chdir(__dirname); process.chdir(__dirname);
@ -45,5 +44,4 @@
assert.equal(stdout, 'fs loaded successfully', assert.equal(stdout, 'fs loaded successfully',
'`node fs` failed!'); '`node fs` failed!');
}); });
} }
})();

Loading…
Cancel
Save