summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTeddy Katz <teddy.katz@gmail.com>2016-09-18 01:43:49 -0400
committerTeddy Katz <teddy.katz@gmail.com>2016-09-20 23:21:10 -0400
commitb1b1978ec5a533607c5c2decaec44f00ff0a80b4 (patch)
treee86a9a4c5739cee17ae8db011acf30fccd9d8e0f /test
parent66df5d147f65cc1a36098987e2d6131c5403c0fc (diff)
downloadandroid-node-v8-b1b1978ec5a533607c5c2decaec44f00ff0a80b4.tar.gz
android-node-v8-b1b1978ec5a533607c5c2decaec44f00ff0a80b4.tar.bz2
android-node-v8-b1b1978ec5a533607c5c2decaec44f00ff0a80b4.zip
tools: add additional ESLint rules
PR-URL: https://github.com/nodejs/node/pull/8643 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@keybase.io>
Diffstat (limited to 'test')
-rw-r--r--test/inspector/inspector-helper.js6
-rw-r--r--test/inspector/test-inspector.js20
-rw-r--r--test/message/throw_in_line_with_tabs.js2
-rw-r--r--test/parallel/test-debug-protocol-execute.js4
-rw-r--r--test/parallel/test-http-multi-line-headers.js2
-rw-r--r--test/parallel/test-http-response-multi-content-length.js2
-rw-r--r--test/parallel/test-http-response-multiheaders.js2
-rw-r--r--test/parallel/test-regress-GH-5727.js2
-rw-r--r--test/parallel/test-repl.js4
-rw-r--r--test/parallel/test-stream2-writable.js4
-rw-r--r--test/parallel/test-tls-cipher-list.js6
-rw-r--r--test/parallel/test-tls-client-verify.js2
-rw-r--r--test/sequential/test-process-warnings.js2
13 files changed, 29 insertions, 29 deletions
diff --git a/test/inspector/inspector-helper.js b/test/inspector/inspector-helper.js
index 865ddeb3b5..bd7d3748cc 100644
--- a/test/inspector/inspector-helper.js
+++ b/test/inspector/inspector-helper.js
@@ -77,9 +77,9 @@ function checkHttpResponse(port, path, callback) {
http.get({port, path}, function(res) {
let response = '';
res.setEncoding('utf8');
- res.
- on('data', (data) => response += data.toString()).
- on('end', () => callback(JSON.parse(response)));
+ res
+ .on('data', (data) => response += data.toString())
+ .on('end', () => callback(JSON.parse(response)));
});
}
diff --git a/test/inspector/test-inspector.js b/test/inspector/test-inspector.js
index e2493c8739..91d930851b 100644
--- a/test/inspector/test-inspector.js
+++ b/test/inspector/test-inspector.js
@@ -85,9 +85,9 @@ function testBreakpointOnStart(session) {
{ 'method': 'Runtime.runIfWaitingForDebugger' }
];
- session.
- sendInspectorCommands(commands).
- expectMessages(setupExpectBreakOnLine(0, session.mainScriptPath, session));
+ session
+ .sendInspectorCommands(commands)
+ .expectMessages(setupExpectBreakOnLine(0, session.mainScriptPath, session));
}
function testSetBreakpointAndResume(session) {
@@ -105,9 +105,9 @@ function testSetBreakpointAndResume(session) {
'params': { 'scriptId': session.mainScriptId } },
expectMainScriptSource ],
];
- session.
- sendInspectorCommands(commands).
- expectMessages([
+ session
+ .sendInspectorCommands(commands)
+ .expectMessages([
setupExpectConsoleOutput('log', ['A message', 5]),
setupExpectBreakOnLine(5, session.mainScriptPath,
session, (id) => scopeId = id),
@@ -131,7 +131,7 @@ function testInspectScope(session) {
[
{
'method': 'Debugger.evaluateOnCallFrame', 'params': {
- 'callFrameId': '{\"ordinal\":0,\"injectedScriptId\":1}',
+ 'callFrameId': '{"ordinal":0,"injectedScriptId":1}',
'expression': 'k + t',
'objectGroup': 'console',
'includeCommandLineAPI': true,
@@ -153,9 +153,9 @@ function testInspectScope(session) {
function testWaitsForFrontendDisconnect(session, harness) {
console.log('[test]', 'Verify node waits for the frontend to disconnect');
- session.sendInspectorCommands({ 'method': 'Debugger.resume'}).
- expectStderrOutput('Waiting for the debugger to disconnect...').
- disconnect(true);
+ session.sendInspectorCommands({ 'method': 'Debugger.resume'})
+ .expectStderrOutput('Waiting for the debugger to disconnect...')
+ .disconnect(true);
}
function runTests(harness) {
diff --git a/test/message/throw_in_line_with_tabs.js b/test/message/throw_in_line_with_tabs.js
index 3bb403feb3..ad95d66e97 100644
--- a/test/message/throw_in_line_with_tabs.js
+++ b/test/message/throw_in_line_with_tabs.js
@@ -1,4 +1,4 @@
-/* eslint-disable indent */
+/* eslint-disable indent, no-tabs */
'use strict';
require('../common');
diff --git a/test/parallel/test-debug-protocol-execute.js b/test/parallel/test-debug-protocol-execute.js
index e87b25f5cb..2283a3c54e 100644
--- a/test/parallel/test-debug-protocol-execute.js
+++ b/test/parallel/test-debug-protocol-execute.js
@@ -15,6 +15,6 @@ assert.strictEqual(protocol.res.body, undefined);
protocol.state = 'sterrance';
assert.throws(
- () => { protocol.execute('grumblecakes'); },
- /^Error: Unknown state$/
+ () => { protocol.execute('grumblecakes'); },
+ /^Error: Unknown state$/
);
diff --git a/test/parallel/test-http-multi-line-headers.js b/test/parallel/test-http-multi-line-headers.js
index f534b3b8db..df333cdd62 100644
--- a/test/parallel/test-http-multi-line-headers.js
+++ b/test/parallel/test-http-multi-line-headers.js
@@ -14,7 +14,7 @@ var server = net.createServer(function(conn) {
'Content-Length: ' + body.length + '\r\n' +
'Content-Type: text/plain;\r\n' +
' x-unix-mode=0600;\r\n' +
- ' name=\"hello.txt\"\r\n' +
+ ' name="hello.txt"\r\n' +
'\r\n' +
body;
diff --git a/test/parallel/test-http-response-multi-content-length.js b/test/parallel/test-http-response-multi-content-length.js
index 098061002b..3290f74c16 100644
--- a/test/parallel/test-http-response-multi-content-length.js
+++ b/test/parallel/test-http-response-multi-content-length.js
@@ -27,7 +27,7 @@ const server = http.createServer((req, res) => {
var count = 0;
server.listen(0, common.mustCall(() => {
- for (let n = 1; n <= MAX_COUNT ; n++) {
+ for (let n = 1; n <= MAX_COUNT; n++) {
// This runs twice, the first time, the server will use
// setHeader, the second time it uses writeHead. In either
// case, the error handler must be called because the client
diff --git a/test/parallel/test-http-response-multiheaders.js b/test/parallel/test-http-response-multiheaders.js
index 577f401abb..f4c1fd4116 100644
--- a/test/parallel/test-http-response-multiheaders.js
+++ b/test/parallel/test-http-response-multiheaders.js
@@ -48,7 +48,7 @@ const server = http.createServer(function(req, res) {
server.listen(0, common.mustCall(function() {
var count = 0;
- for (let n = 1; n <= 2 ; n++) {
+ for (let n = 1; n <= 2; n++) {
// this runs twice, the first time, the server will use
// setHeader, the second time it uses writeHead. The
// result on the client side should be the same in
diff --git a/test/parallel/test-regress-GH-5727.js b/test/parallel/test-regress-GH-5727.js
index ae8cca9cbf..3f52c55e7a 100644
--- a/test/parallel/test-regress-GH-5727.js
+++ b/test/parallel/test-regress-GH-5727.js
@@ -4,7 +4,7 @@ const assert = require('assert');
const net = require('net');
const invalidPort = -1 >>> 0;
-const errorMessage = /"port" argument must be \>= 0 and \< 65536/;
+const errorMessage = /"port" argument must be >= 0 and < 65536/;
net.Server().listen(common.PORT, function() {
const address = this.address();
diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js
index 495125f6dc..a6603332aa 100644
--- a/test/parallel/test-repl.js
+++ b/test/parallel/test-repl.js
@@ -160,7 +160,7 @@ function error_test() {
// invalid RegExps are a special case of syntax error,
// should throw
{ client: client_unix, send: '/(/;',
- expect: /\bSyntaxError: Invalid regular expression\:/ },
+ expect: /\bSyntaxError: Invalid regular expression:/ },
// invalid RegExp modifiers are a special case of syntax error,
// should throw (GH-4012)
{ client: client_unix, send: 'new RegExp("foo", "wrong modifier");',
@@ -313,7 +313,7 @@ function error_test() {
{ client: client_unix, send: "function x(s) {\nreturn s.replace(/'/,'');\n}",
expect: prompt_multiline + prompt_multiline +
'undefined\n' + prompt_unix },
- { client: client_unix, send: "function x(s) {\nreturn s.replace(/\'/,'');\n}",
+ { client: client_unix, send: "function x(s) {\nreturn s.replace(/'/,'');\n}",
expect: prompt_multiline + prompt_multiline +
'undefined\n' + prompt_unix },
{ client: client_unix, send: 'function x(s) {\nreturn s.replace(/"/,"");\n}',
diff --git a/test/parallel/test-stream2-writable.js b/test/parallel/test-stream2-writable.js
index 57877b048b..050c2121b2 100644
--- a/test/parallel/test-stream2-writable.js
+++ b/test/parallel/test-stream2-writable.js
@@ -154,7 +154,7 @@ test('write bufferize', function(t) {
});
chunks.forEach(function(chunk, i) {
- var enc = encodings[ i % encodings.length ];
+ var enc = encodings[i % encodings.length];
chunk = Buffer.from(chunk);
tw.write(chunk.toString(enc), enc);
});
@@ -192,7 +192,7 @@ test('write no bufferize', function(t) {
});
chunks.forEach(function(chunk, i) {
- var enc = encodings[ i % encodings.length ];
+ var enc = encodings[i % encodings.length];
chunk = Buffer.from(chunk);
tw.write(chunk.toString(enc), enc);
});
diff --git a/test/parallel/test-tls-cipher-list.js b/test/parallel/test-tls-cipher-list.js
index ba844c944e..44ebd3d2f8 100644
--- a/test/parallel/test-tls-cipher-list.js
+++ b/test/parallel/test-tls-cipher-list.js
@@ -16,9 +16,9 @@ function doCheck(arg, check) {
'-pe',
'require("crypto").constants.defaultCipherList'
]);
- spawn(process.execPath, arg, {}).
- on('error', common.fail).
- stdout.on('data', function(chunk) {
+ spawn(process.execPath, arg, {})
+ .on('error', common.fail)
+ .stdout.on('data', function(chunk) {
out += chunk;
}).on('end', function() {
assert.equal(out.trim(), check);
diff --git a/test/parallel/test-tls-client-verify.js b/test/parallel/test-tls-client-verify.js
index e566cafc8c..7844253db9 100644
--- a/test/parallel/test-tls-client-verify.js
+++ b/test/parallel/test-tls-client-verify.js
@@ -10,7 +10,7 @@ var tls = require('tls');
var fs = require('fs');
-var hosterr = /Hostname\/IP doesn\'t match certificate\'s altnames/g;
+var hosterr = /Hostname\/IP doesn't match certificate's altnames/g;
var testCases =
[{ ca: ['ca1-cert'],
key: 'agent2-key',
diff --git a/test/sequential/test-process-warnings.js b/test/sequential/test-process-warnings.js
index 3ae00c8158..1e8b2b13a2 100644
--- a/test/sequential/test-process-warnings.js
+++ b/test/sequential/test-process-warnings.js
@@ -29,5 +29,5 @@ execFile(node, traceWarn, function(er, stdout, stderr) {
assert.equal(er, null);
assert.equal(stdout, '');
assert(/^\(.+\)\sWarning: a bad practice warning/.test(stderr));
- assert(/at Object\.\<anonymous\>\s\(.+warnings.js:3:9\)/.test(stderr));
+ assert(/at Object\.<anonymous>\s\(.+warnings.js:3:9\)/.test(stderr));
});