Browse Source

test: enable linting for tests

Enable linting for the test directory. A number of changes was made so
all tests conform the current rules used by lib and src directories. The
only exception for tests is that unreachable (dead) code is allowed.

test-fs-non-number-arguments-throw had to be excluded from the changes
because of a weird issue on Windows CI.

PR-URL: https://github.com/nodejs/io.js/pull/1721
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
v2.3.1-release
Roman Reiss 10 years ago
parent
commit
f29762f4dd
  1. 3
      .eslintignore
  2. 5
      .eslintrc
  3. 2
      Makefile
  4. 5
      test/.eslintrc
  5. 1
      test/addons/async-hello-world/test.js
  6. 1
      test/addons/at-exit/test.js
  7. 1
      test/addons/hello-world-function-export/test.js
  8. 1
      test/addons/hello-world/test.js
  9. 1
      test/addons/repl-domain-abort/test.js
  10. 1
      test/addons/smalloc-alloc/test.js
  11. 23
      test/common.js
  12. 3
      test/debugger/helper-debugger-repl.js
  13. 3
      test/debugger/test-debug-break-on-uncaught.js
  14. 1
      test/debugger/test-debugger-client.js
  15. 1
      test/debugger/test-debugger-debug-brk.js
  16. 1
      test/debugger/test-debugger-remote.js
  17. 1
      test/debugger/test-debugger-repl-break-in-module.js
  18. 3
      test/debugger/test-debugger-repl-restart.js
  19. 1
      test/debugger/test-debugger-repl-term.js
  20. 1
      test/debugger/test-debugger-repl-utf8.js
  21. 1
      test/debugger/test-debugger-repl.js
  22. 1
      test/disabled/GH-670.js
  23. 1
      test/disabled/test-cat.js
  24. 1
      test/disabled/test-child-process-custom-fds.js
  25. 1
      test/disabled/test-child-process-customfd-bounded.js
  26. 1
      test/disabled/test-child-process-uid-gid.js
  27. 1
      test/disabled/test-debug-brk-file.js
  28. 1
      test/disabled/test-debug-brk-no-arg.js
  29. 1
      test/disabled/test-dgram-multicast.js
  30. 1
      test/disabled/test-dgram-send-error.js
  31. 1
      test/disabled/test-dgram-unix-anon.js
  32. 1
      test/disabled/test-dgram-unix.js
  33. 3
      test/disabled/test-eio-race.js
  34. 1
      test/disabled/test-eio-race2.js
  35. 1
      test/disabled/test-eio-race3.js
  36. 1
      test/disabled/test-eio-race4.js
  37. 1
      test/disabled/test-fs-largefile.js
  38. 1
      test/disabled/test-http-abort-stream-end.js
  39. 1
      test/disabled/test-http-agent2.js
  40. 1
      test/disabled/test-http-big-proxy-responses.js
  41. 1
      test/disabled/test-http-head-request.js
  42. 1
      test/disabled/test-http-stress.js
  43. 1
      test/disabled/test-http-tls.js
  44. 19
      test/disabled/test-https-loop-to-google.js
  45. 1
      test/disabled/test-idle-watcher.js
  46. 1
      test/disabled/test-net-fd-passing.js
  47. 1
      test/disabled/test-net-tls-pummel.js
  48. 1
      test/disabled/test-net-tls.js
  49. 1
      test/disabled/test-process-title.js
  50. 12
      test/disabled/test-readline.js
  51. 1
      test/disabled/test-remote-module-loading.js
  52. 1
      test/disabled/test-sendfd.js
  53. 1
      test/disabled/test-setuidgid.js
  54. 2
      test/disabled/test-tls-large-push.js
  55. 1
      test/disabled/test-tls-server.js
  56. 1
      test/disabled/test-tty-stdio.js
  57. 1
      test/disabled/tls-client.js
  58. 1
      test/disabled/tls_client.js
  59. 1
      test/disabled/tls_server.js
  60. 1
      test/gc/node_modules/weak/lib/weak.js
  61. 3
      test/gc/test-http-client-connaborted.js
  62. 3
      test/gc/test-http-client-onerror.js
  63. 7
      test/gc/test-http-client-timeout.js
  64. 7
      test/gc/test-http-client.js
  65. 1
      test/gc/test-net-timeout.js
  66. 3
      test/internet/test-dgram-broadcast-multi-process.js
  67. 1
      test/internet/test-dgram-multicast-multi-process.js
  68. 1
      test/internet/test-dns-txt-sigsegv.js
  69. 7
      test/internet/test-dns.js
  70. 1
      test/internet/test-http-dns-fail.js
  71. 1
      test/internet/test-http-https-default-ports.js
  72. 1
      test/internet/test-net-connect-timeout.js
  73. 3
      test/internet/test-net-connect-unref.js
  74. 1
      test/internet/test-tls-connnect-melissadata.js
  75. 1
      test/internet/test-tls-reuse-host-from-socket.js
  76. 1
      test/message/2100bytes.js
  77. 1
      test/message/error_exit.js
  78. 1
      test/message/eval_messages.js
  79. 1
      test/message/hello_world.js
  80. 1
      test/message/max_tick_depth.js
  81. 1
      test/message/nexttick_throw.js
  82. 1
      test/message/stack_overflow.js
  83. 1
      test/message/stdin_messages.js
  84. 1
      test/message/throw_custom_error.js
  85. 2
      test/message/throw_custom_error.out
  86. 2
      test/message/throw_in_line_with_tabs.js
  87. 2
      test/message/throw_in_line_with_tabs.out
  88. 1
      test/message/throw_non_error.js
  89. 2
      test/message/throw_non_error.out
  90. 1
      test/message/throw_null.js
  91. 2
      test/message/throw_null.out
  92. 1
      test/message/throw_undefined.js
  93. 2
      test/message/throw_undefined.out
  94. 1
      test/message/timeout_throw.js
  95. 1
      test/message/undefined_reference_in_new_context.js
  96. 1
      test/message/vm_display_runtime_error.js
  97. 1
      test/message/vm_display_syntax_error.js
  98. 1
      test/message/vm_dont_display_runtime_error.js
  99. 1
      test/message/vm_dont_display_syntax_error.js
  100. 1
      test/parallel/test-arm-math-exp-regress-1376.js

3
.eslintignore

@ -1 +1,4 @@
lib/punycode.js
test/fixtures
test/**/node_modules
test/parallel/test-fs-non-number-arguments-throw.js

5
.eslintrc

@ -8,6 +8,7 @@ ecmaFeatures:
octalLiterals: true
binaryLiterals: true
generators: true
forOf: true
rules:
# Possible Errors
@ -54,6 +55,10 @@ rules:
space-infix-ops: 2
## require spaces return, throw, case
space-return-throw-case: 2
## no space before function, eg. 'function()'
space-before-function-paren: [2, "never"]
## require space before blocks, eg 'function() {'
space-before-blocks: [2, "always"]
## require parens for Constructor
new-parens: 2
## max 80 length

2
Makefile

@ -375,7 +375,7 @@ bench-idle:
./$(NODE_EXE) benchmark/idle_clients.js &
jslint:
./$(NODE_EXE) tools/eslint/bin/eslint.js src lib --reset --quiet
./$(NODE_EXE) tools/eslint/bin/eslint.js src lib test --reset --quiet
CPPLINT_EXCLUDE ?=
CPPLINT_EXCLUDE += src/node_lttng.cc

5
test/.eslintrc

@ -0,0 +1,5 @@
## Test-specific linter rules
rules:
## allow unreachable code
no-unreachable: 0

1
test/addons/async-hello-world/test.js

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

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

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

1
test/addons/hello-world-function-export/test.js

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

1
test/addons/hello-world/test.js

@ -1,3 +1,4 @@
'use strict';
var assert = require('assert');
var binding = require('./build/Release/binding');
assert.equal('world', binding.hello());

1
test/addons/repl-domain-abort/test.js

@ -1,3 +1,4 @@
'use strict';
var assert = require('assert');
var repl = require('repl');
var stream = require('stream');

1
test/addons/smalloc-alloc/test.js

@ -1,3 +1,4 @@
'use strict';
var assert = require('assert');
var binding = require('./build/Release/binding');
var obj = binding.alloc(16);

23
test/common.js

@ -1,3 +1,4 @@
'use strict';
var path = require('path');
var fs = require('fs');
var assert = require('assert');
@ -107,8 +108,8 @@ if (process.env.NODE_COMMON_PIPE) {
if (process.platform === 'win32') {
exports.faketimeCli = false;
} else {
exports.faketimeCli = path.join(__dirname, "..", "tools", "faketime", "src",
"faketime");
exports.faketimeCli = path.join(__dirname, '..', 'tools', 'faketime', 'src',
'faketime');
}
var ifaces = os.networkInterfaces();
@ -307,7 +308,7 @@ exports.mustCall = function(fn, expected) {
var context = {
expected: expected,
actual: 0,
stack: (new Error).stack,
stack: (new Error()).stack,
name: fn.name || '<anonymous>'
};
@ -345,11 +346,11 @@ if (process.platform === 'win32') {
*/
exports.getServiceName = function getServiceName(port, protocol) {
if (port == null) {
throw new Error("Missing port number");
throw new Error('Missing port number');
}
if (typeof protocol !== 'string') {
throw new Error("Protocol must be a string");
throw new Error('Protocol must be a string');
}
/*
@ -360,10 +361,10 @@ exports.getServiceName = function getServiceName(port, protocol) {
try {
/*
* I'm not a big fan of readFileSync, but reading /etc/services asynchronously
* here would require implementing a simple line parser, which seems overkill
* for a simple utility function that is not running concurrently with any
* other one.
* I'm not a big fan of readFileSync, but reading /etc/services
* asynchronously here would require implementing a simple line parser,
* which seems overkill for a simple utility function that is not running
* concurrently with any other one.
*/
var servicesContent = fs.readFileSync(etcServicesFileName,
{ encoding: 'utf8'});
@ -380,7 +381,7 @@ exports.getServiceName = function getServiceName(port, protocol) {
}
return serviceName;
}
};
exports.hasMultiLocalhost = function hasMultiLocalhost() {
var TCP = process.binding('tcp_wrap').TCP;
@ -397,7 +398,7 @@ exports.isValidHostname = function(str) {
'(\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9]))*$');
return !!str.match(re) && str.length <= 255;
}
};
exports.fileExists = function(pathname) {
try {

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

@ -1,3 +1,4 @@
'use strict';
process.env.NODE_DEBUGGER_TIMEOUT = 2000;
var common = require('../common');
var assert = require('assert');
@ -55,7 +56,7 @@ function startDebugger(scriptToDebug) {
quitCalled = true;
child.stdin.write('quit');
child.kill('SIGTERM');
}
};
setTimeout(function() {
console.error('dying badly buffer=%j', buffer);

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

@ -1,3 +1,4 @@
'use strict';
var path = require('path');
var assert = require('assert');
var spawn = require('child_process').spawn;
@ -44,7 +45,7 @@ function runScenario(scriptName, throwsInFile, throwsOnLine, next) {
child.on('close', function() {
assert(asserted, 'debugger did not pause on exception');
if (next) next();
})
});
var exceptions = [];

1
test/debugger/test-debugger-client.js

@ -1,3 +1,4 @@
'use strict';
process.env.NODE_DEBUGGER_TIMEOUT = 2000;
var common = require('../common');
var assert = require('assert');

1
test/debugger/test-debugger-debug-brk.js

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

1
test/debugger/test-debugger-remote.js

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

1
test/debugger/test-debugger-repl-break-in-module.js

@ -1,3 +1,4 @@
'use strict';
var repl = require('./helper-debugger-repl.js');
repl.startDebugger('break-in-module/main.js');

3
test/debugger/test-debugger-repl-restart.js

@ -1,3 +1,4 @@
'use strict';
var repl = require('./helper-debugger-repl.js');
repl.startDebugger('breakpoints.js');
@ -7,7 +8,7 @@ var linesWithBreakpoint = [
// We slice here, because addTest will change the given array.
repl.addTest('sb(6)', linesWithBreakpoint.slice());
var initialLines = repl.initialLines.slice()
var initialLines = repl.initialLines.slice();
initialLines.splice(2, 0, /Restoring/, /Warning/);
// Restart the debugged script

1
test/debugger/test-debugger-repl-term.js

@ -1,3 +1,4 @@
'use strict';
process.env.NODE_FORCE_READLINE = 1;
var repl = require('./helper-debugger-repl.js');

1
test/debugger/test-debugger-repl-utf8.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var script = common.fixturesDir + '/breakpoints_utf8.js';
process.env.NODE_DEBUGGER_TEST_SCRIPT = script;

1
test/debugger/test-debugger-repl.js

@ -1,3 +1,4 @@
'use strict';
var repl = require('./helper-debugger-repl.js');
repl.startDebugger('breakpoints.js');

1
test/disabled/GH-670.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var https = require('https');

1
test/disabled/test-cat.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common.js');
var assert = require('assert');
var http = require('http');

1
test/disabled/test-child-process-custom-fds.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/disabled/test-child-process-customfd-bounded.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var bigish = Array(200);

1
test/disabled/test-child-process-uid-gid.js

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

1
test/disabled/test-debug-brk-file.js

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

1
test/disabled/test-debug-brk-no-arg.js

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

1
test/disabled/test-dgram-multicast.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

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

@ -1,3 +1,4 @@
'use strict';
// Some operating systems report errors when an UDP message is sent to an
// unreachable host. This error can be reported by sendto() and even by
// recvfrom(). Node should not propagate this error to the user.

1
test/disabled/test-dgram-unix-anon.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/disabled/test-dgram-unix.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

3
test/disabled/test-eio-race.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
@ -36,7 +37,7 @@ function tryToKillEventLoop() {
// Generate a lot of thread pool events
var pos = 0;
fs.open(filename, 'r', 0666, function(err, fd) {
fs.open(filename, 'r', 0o666, function(err, fd) {
if (err) throw err;
function readChunk() {

1
test/disabled/test-eio-race2.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var path = require('path');

1
test/disabled/test-eio-race3.js

@ -1,3 +1,4 @@
'use strict';
/* XXX Can this test be modified to not call the now-removed wait()? */
var common = require('../common');

1
test/disabled/test-eio-race4.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var fs = require('fs');

1
test/disabled/test-fs-largefile.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var path = require('path'),

1
test/disabled/test-http-abort-stream-end.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/disabled/test-http-agent2.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var http = require('http');

1
test/disabled/test-http-big-proxy-responses.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var util = require('util'),

1
test/disabled/test-http-head-request.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/disabled/test-http-stress.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/disabled/test-http-tls.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

19
test/disabled/test-https-loop-to-google.js

@ -1,3 +1,4 @@
'use strict';
// Failing test for https
// Will fail with "socket hang up" for 4 out of 10 requests
@ -7,26 +8,20 @@
var common = require('../common');
var https = require('https');
for (var i = 0; i < 10; ++i)
{
https.get(
{
for (var i = 0; i < 10; ++i) {
https.get({
host: 'www.google.com',
path: '/accounts/o8/id',
port: 443
}, function(res)
{
}, function(res) {
var data = '';
res.on('data', function(chunk)
{
res.on('data', function(chunk) {
data += chunk;
});
res.on('end', function()
{
res.on('end', function() {
console.log(res.statusCode);
});
}).on('error', function(error)
{
}).on('error', function(error) {
console.log(error);
});
}

1
test/disabled/test-idle-watcher.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/disabled/test-net-fd-passing.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var net = require('net');

1
test/disabled/test-net-tls-pummel.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/disabled/test-net-tls.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var fs = require('fs');

1
test/disabled/test-process-title.js

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

12
test/disabled/test-readline.js

@ -1,3 +1,4 @@
'use strict';
// Can't test this when 'make test' doesn't assign a tty to the stdout.
// Yet another use-case for require('tty').spawn ?
var common = require('../common');
@ -39,7 +40,7 @@ var readlineFakeStream = function() {
process.stdout.write = function(data) {
data.split('').forEach(rl.written_bytes.push.bind(rl.written_bytes));
_stdoutWrite.apply(this, arguments);
}
};
rl.written_bytes = written_bytes;
return rl;
};
@ -83,7 +84,14 @@ rl.write.apply(rl, key.xterm.home);
rl = readlineFakeStream();
rl.write('foo bar.hop/zoo');
rl.write.apply(rl, key.xterm.home);
['bar.hop/zoo', '.hop/zoo', 'hop/zoo', '/zoo', 'zoo', ''].forEach(function (expectedLine) {
[
'bar.hop/zoo',
'.hop/zoo',
'hop/zoo',
'/zoo',
'zoo',
''
].forEach(function(expectedLine) {
rl.write.apply(rl, key.xterm.metad);
assert.equal(0, rl.cursor);
assert.equal(expectedLine, rl.line);

1
test/disabled/test-remote-module-loading.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/disabled/test-sendfd.js

@ -1,3 +1,4 @@
'use strict';
// Test sending and receiving a file descriptor.
//
// This test is pretty complex. It ends up spawning test/fixtures/recvfd.js

1
test/disabled/test-setuidgid.js

@ -1,3 +1,4 @@
'use strict';
// Requires special privileges
var common = require('../common');
var assert = require('assert');

2
test/disabled/test-tls-large-push.js

@ -1,3 +1,5 @@
/* eslint-disable no-debugger */
'use strict';
// Server sends a large string. Client counts bytes and pauses every few
// seconds. Makes sure that pause and resume work properly.
var common = require('../common');

1
test/disabled/test-tls-server.js

@ -1,3 +1,4 @@
'use strict';
// Example of new TLS API. Test with:
//
// $> openssl s_client -connect localhost:12346 \

1
test/disabled/test-tty-stdio.js

@ -1,3 +1,4 @@
'use strict';
// Can't test this when 'make test' doesn't assign a tty to the stdout.
var common = require('../common');
var assert = require('assert');

1
test/disabled/tls-client.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var tls = require('tls');
var fs = require('fs');

1
test/disabled/tls_client.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/disabled/tls_server.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/gc/node_modules/weak/lib/weak.js

@ -1,3 +1,4 @@
'use strict';
var bindings
try {
bindings = require('../build/Release/weakref.node')

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

@ -1,3 +1,4 @@
'use strict';
// just like test/gc/http-client.js,
// but aborting every connection that comes in.
@ -39,7 +40,7 @@ function getall() {
count++;
weak(req, afterGC);
})()
})();
setImmediate(getall);
}

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

@ -1,3 +1,4 @@
'use strict';
// just like test/gc/http-client.js,
// but with an on('error') handler that does nothing.
@ -45,7 +46,7 @@ function getall() {
count++;
weak(req, afterGC);
})()
})();
setImmediate(getall);
}

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

@ -1,10 +1,11 @@
'use strict';
// just like test/gc/http-client.js,
// but with a timeout set
function serverHandler(req, res) {
setTimeout(function() {
req.resume();
res.writeHead(200)
res.writeHead(200);
res.end('hello\n');
}, 100);
}
@ -43,12 +44,12 @@ function getall() {
}, cb);
req.on('error', cb);
req.setTimeout(10, function() {
console.log('timeout (expected)')
console.log('timeout (expected)');
});
count++;
weak(req, afterGC);
})()
})();
setImmediate(getall);
}

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

@ -1,3 +1,4 @@
'use strict';
// just a simple http server and client.
function serverHandler(req, res) {
@ -29,7 +30,7 @@ function getall() {
(function() {
function cb(res) {
res.resume();
console.error('in cb')
console.error('in cb');
done += 1;
res.on('end', gc);
}
@ -38,11 +39,11 @@ function getall() {
hostname: 'localhost',
pathname: '/',
port: PORT
}, cb)
}, cb);
count++;
weak(req, afterGC);
})()
})();
setImmediate(getall);
}

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

@ -1,3 +1,4 @@
'use strict';
// just like test/gc/http-client-timeout.js,
// but using a net server/client instead

3
test/internet/test-dgram-broadcast-multi-process.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common'),
assert = require('assert'),
dgram = require('dgram'),
@ -162,9 +163,7 @@ if (process.argv[2] !== 'child') {
sendSocket.send(buf, 0, buf.length,
common.PORT, LOCAL_BROADCAST_HOST, function(err) {
if (err) throw err;
console.error('[PARENT] sent %s to %s:%s',
util.inspect(buf.toString()),
LOCAL_BROADCAST_HOST, common.PORT);

1
test/internet/test-dgram-multicast-multi-process.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common'),
assert = require('assert'),
dgram = require('dgram'),

1
test/internet/test-dns-txt-sigsegv.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var dns = require('dns');

7
test/internet/test-dns.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert'),
dns = require('dns'),
@ -500,7 +501,8 @@ TEST(function test_lookup_null_all(done) {
TEST(function test_lookup_all_ipv4(done) {
var req = dns.lookup('www.google.com', {all: true, family: 4}, function(err, ips) {
var req = dns.lookup('www.google.com', {all: true, family: 4},
function(err, ips) {
if (err) throw err;
assert.ok(Array.isArray(ips));
assert.ok(ips.length > 0);
@ -518,7 +520,8 @@ TEST(function test_lookup_all_ipv4(done) {
TEST(function test_lookup_all_ipv6(done) {
var req = dns.lookup('www.google.com', {all: true, family: 6}, function(err, ips) {
var req = dns.lookup('www.google.com', {all: true, family: 6},
function(err, ips) {
if (err) throw err;
assert.ok(Array.isArray(ips));
assert.ok(ips.length > 0);

1
test/internet/test-http-dns-fail.js

@ -1,3 +1,4 @@
'use strict';
/*
* Repeated requests for a domain that fails to resolve
* should trigger the error event after each attempt.

1
test/internet/test-http-https-default-ports.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/internet/test-net-connect-timeout.js

@ -1,3 +1,4 @@
'use strict';
// This example attempts to time out before the connection is established
// https://groups.google.com/forum/#!topic/nodejs/UE0ZbfLt6t8
// https://groups.google.com/forum/#!topic/nodejs-dev/jR7-5UDqXkw

3
test/internet/test-net-connect-unref.js

@ -1,9 +1,10 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var net = require('net');
var client, killed = false, ended = false;
var TIMEOUT = 10 * 1000
var TIMEOUT = 10 * 1000;
client = net.createConnection(53, '8.8.8.8', function() {
client.unref();

1
test/internet/test-tls-connnect-melissadata.js

@ -1,3 +1,4 @@
'use strict';
// Test for authorized access to the server which has a cross root
// certification between Starfield Class 2 and ValiCert Class 2
var tls = require('tls');

1
test/internet/test-tls-reuse-host-from-socket.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/message/2100bytes.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var util = require('util');

1
test/message/error_exit.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/message/eval_messages.js

@ -1,3 +1,4 @@
'use strict';
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var common = require('../common');

1
test/message/hello_world.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/message/max_tick_depth.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
process.maxTickDepth = 10;

1
test/message/nexttick_throw.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/message/stack_overflow.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/message/stdin_messages.js

@ -1,3 +1,4 @@
'use strict';
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var common = require('../common');

1
test/message/throw_custom_error.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

2
test/message/throw_custom_error.out

@ -1,5 +1,5 @@
before
*test*message*throw_custom_error.js:7
*test*message*throw_custom_error.js:8
throw ({ name: 'MyCustomError', message: 'This is a custom message' });
^
MyCustomError: This is a custom message

2
test/message/throw_in_line_with_tabs.js

@ -1,3 +1,5 @@
/* eslint-disable indent */
'use strict';
var common = require('../common');
var assert = require('assert');

2
test/message/throw_in_line_with_tabs.out

@ -1,5 +1,5 @@
before
*test*message*throw_in_line_with_tabs.js:8
*test*message*throw_in_line_with_tabs.js:10
throw ({ foo: 'bar' });
^
[object Object]

1
test/message/throw_non_error.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

2
test/message/throw_non_error.out

@ -1,5 +1,5 @@
before
*test*message*throw_non_error.js:7
*test*message*throw_non_error.js:8
throw ({ foo: 'bar' });
^
[object Object]

1
test/message/throw_null.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

2
test/message/throw_null.out

@ -1,5 +1,5 @@
*test*message*throw_null.js:4
*test*message*throw_null.js:5
throw null;
^
null

1
test/message/throw_undefined.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

2
test/message/throw_undefined.out

@ -1,5 +1,5 @@
*test*message*throw_undefined.js:4
*test*message*throw_undefined.js:5
throw undefined;
^
undefined

1
test/message/timeout_throw.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');

1
test/message/undefined_reference_in_new_context.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var vm = require('vm');

1
test/message/vm_display_runtime_error.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var vm = require('vm');

1
test/message/vm_display_syntax_error.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var vm = require('vm');

1
test/message/vm_dont_display_runtime_error.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var vm = require('vm');

1
test/message/vm_dont_display_syntax_error.js

@ -1,3 +1,4 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var vm = require('vm');

1
test/parallel/test-arm-math-exp-regress-1376.js

@ -1,3 +1,4 @@
'use strict';
// See https://github.com/nodejs/io.js/issues/1376
// and https://code.google.com/p/v8/issues/detail?id=4019

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save