aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-03-02 02:44:18 +0000
committerAnatoli Papirovski <apapirovski@mac.com>2018-03-04 15:33:18 +0100
commitf2d93795bfe61a3260bf743d2247b56b83fc6f70 (patch)
tree2edc3c4ced9bc6309e3a93c3af474adf16933187 /test
parent7bc8eb8da7ccdcd67edaf612b6599ec04ab77cb1 (diff)
downloadandroid-node-v8-f2d93795bfe61a3260bf743d2247b56b83fc6f70.tar.gz
android-node-v8-f2d93795bfe61a3260bf743d2247b56b83fc6f70.tar.bz2
android-node-v8-f2d93795bfe61a3260bf743d2247b56b83fc6f70.zip
lib,test: remove yoda statements
PR-URL: https://github.com/nodejs/node/pull/18746 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/common/inspector-helper.js4
-rw-r--r--test/parallel/test-dns-multi-channel.js2
-rw-r--r--test/parallel/test-fs-watch-recursive.js2
-rw-r--r--test/parallel/test-net-pingpong.js2
-rw-r--r--test/parallel/test-net-server-max-connections.js2
-rw-r--r--test/parallel/test-tls-pause.js2
-rw-r--r--test/pummel/test-net-throttle.js2
-rw-r--r--test/pummel/test-next-tick-infinite-calls.js2
8 files changed, 9 insertions, 9 deletions
diff --git a/test/common/inspector-helper.js b/test/common/inspector-helper.js
index de0723933f..7590cfc104 100644
--- a/test/common/inspector-helper.js
+++ b/test/common/inspector-helper.js
@@ -241,7 +241,7 @@ class InspectorSession {
}
_isBreakOnLineNotification(message, line, expectedScriptPath) {
- if ('Debugger.paused' === message.method) {
+ if (message.method === 'Debugger.paused') {
const callFrame = message.params.callFrames[0];
const location = callFrame.location;
const scriptPath = this._scriptsIdsByUrl.get(location.scriptId);
@@ -264,7 +264,7 @@ class InspectorSession {
_matchesConsoleOutputNotification(notification, type, values) {
if (!Array.isArray(values))
values = [ values ];
- if ('Runtime.consoleAPICalled' === notification.method) {
+ if (notification.method === 'Runtime.consoleAPICalled') {
const params = notification.params;
if (params.type === type) {
let i = 0;
diff --git a/test/parallel/test-dns-multi-channel.js b/test/parallel/test-dns-multi-channel.js
index 63e82c3ed7..bd88fe0b24 100644
--- a/test/parallel/test-dns-multi-channel.js
+++ b/test/parallel/test-dns-multi-channel.js
@@ -31,7 +31,7 @@ for (const { socket, reply } of servers) {
}));
socket.bind(0, common.mustCall(() => {
- if (0 === --waiting) ready();
+ if (--waiting === 0) ready();
}));
}
diff --git a/test/parallel/test-fs-watch-recursive.js b/test/parallel/test-fs-watch-recursive.js
index 82d87aa2ec..4985ece0e0 100644
--- a/test/parallel/test-fs-watch-recursive.js
+++ b/test/parallel/test-fs-watch-recursive.js
@@ -24,7 +24,7 @@ const watcher = fs.watch(testDir, { recursive: true });
let watcherClosed = false;
watcher.on('change', function(event, filename) {
- assert.ok('change' === event || 'rename' === event);
+ assert.ok(event === 'change' || event === 'rename');
// Ignore stale events generated by mkdir and other tests
if (filename !== relativePathOne)
diff --git a/test/parallel/test-net-pingpong.js b/test/parallel/test-net-pingpong.js
index 9fc59db4e2..4ab36fc239 100644
--- a/test/parallel/test-net-pingpong.js
+++ b/test/parallel/test-net-pingpong.js
@@ -53,7 +53,7 @@ function pingPongTest(port, host) {
// Since we never queue data (we're always waiting for the PING
// before sending a pong) the writeQueueSize should always be less
// than one message.
- assert.ok(0 <= socket.bufferSize && socket.bufferSize <= 4);
+ assert.ok(socket.bufferSize >= 0 && socket.bufferSize <= 4);
assert.strictEqual(socket.writable, true);
assert.strictEqual(socket.readable, true);
diff --git a/test/parallel/test-net-server-max-connections.js b/test/parallel/test-net-server-max-connections.js
index c73efb3c1e..a711e5295b 100644
--- a/test/parallel/test-net-server-max-connections.js
+++ b/test/parallel/test-net-server-max-connections.js
@@ -88,7 +88,7 @@ function makeConnection(index) {
c.on('data', function(b) {
gotData = true;
- assert.ok(0 < b.length);
+ assert.ok(b.length > 0);
});
c.on('error', function(e) {
diff --git a/test/parallel/test-tls-pause.js b/test/parallel/test-tls-pause.js
index a6130cd433..e246acff80 100644
--- a/test/parallel/test-tls-pause.js
+++ b/test/parallel/test-tls-pause.js
@@ -60,7 +60,7 @@ server.listen(0, common.mustCall(() => {
console.error('sending');
const ret = client.write(Buffer.allocUnsafe(bufSize));
console.error(`write => ${ret}`);
- if (false !== ret) {
+ if (ret !== false) {
console.error('write again');
sent += bufSize;
assert.ok(sent < 100 * 1024 * 1024); // max 100MB
diff --git a/test/pummel/test-net-throttle.js b/test/pummel/test-net-throttle.js
index ea48aa74d2..a08ed85ccd 100644
--- a/test/pummel/test-net-throttle.js
+++ b/test/pummel/test-net-throttle.js
@@ -39,7 +39,7 @@ const server = net.createServer(function(connection) {
connection.write(body.slice(part_N, 2 * part_N));
assert.strictEqual(false, connection.write(body.slice(2 * part_N, N)));
console.log(`bufferSize: ${connection.bufferSize}`, 'expecting', N);
- assert.ok(0 <= connection.bufferSize &&
+ assert.ok(connection.bufferSize >= 0 &&
connection.writableLength <= N);
connection.end();
});
diff --git a/test/pummel/test-next-tick-infinite-calls.js b/test/pummel/test-next-tick-infinite-calls.js
index b72d18fa40..5ee44076dc 100644
--- a/test/pummel/test-next-tick-infinite-calls.js
+++ b/test/pummel/test-next-tick-infinite-calls.js
@@ -28,7 +28,7 @@ let complete = 0;
// FATAL ERROR: JS Allocation failed - process out of memory
// if the depth counter doesn't clear the nextTickQueue properly.
(function runner() {
- if (1e8 > ++complete)
+ if (++complete < 1e8)
process.nextTick(runner);
}());