From 01c1ee67308eed5b6861f6d25fcc31a85ecd770d Mon Sep 17 00:00:00 2001 From: Nolan Rigo Date: Sat, 20 Oct 2018 21:56:05 +0200 Subject: [PATCH] test: fix strictEqual() arguments order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/23800 Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Shelley Vohr --- test/parallel/test-http-upgrade-server.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/parallel/test-http-upgrade-server.js b/test/parallel/test-http-upgrade-server.js index d8a193c6edb4ec..4271ad920d6c39 100644 --- a/test/parallel/test-http-upgrade-server.js +++ b/test/parallel/test-http-upgrade-server.js @@ -98,20 +98,20 @@ function test_upgrade_with_listener() { conn.on('data', function(data) { state++; - assert.strictEqual('string', typeof data); + assert.strictEqual(typeof data, 'string'); if (state === 1) { - assert.strictEqual('HTTP/1.1 101', data.substr(0, 12)); - assert.strictEqual('WjN}|M(6', request_upgradeHead.toString('utf8')); + assert.strictEqual(data.substr(0, 12), 'HTTP/1.1 101'); + assert.strictEqual(request_upgradeHead.toString('utf8'), 'WjN}|M(6'); conn.write('test', 'utf8'); } else if (state === 2) { - assert.strictEqual('test', data); + assert.strictEqual(data, 'test'); conn.write('kill', 'utf8'); } }); conn.on('end', function() { - assert.strictEqual(2, state); + assert.strictEqual(state, 2); conn.end(); server.removeAllListeners('upgrade'); test_upgrade_no_listener(); @@ -156,8 +156,8 @@ function test_standard_http() { }); conn.once('data', function(data) { - assert.strictEqual('string', typeof data); - assert.strictEqual('HTTP/1.1 200', data.substr(0, 12)); + assert.strictEqual(typeof data, 'string'); + assert.strictEqual(data.substr(0, 12), 'HTTP/1.1 200'); conn.end(); }); @@ -179,6 +179,6 @@ server.listen(0, function() { Fin. -----------------------------------------------*/ process.on('exit', function() { - assert.strictEqual(3, requests_recv); - assert.strictEqual(3, requests_sent); + assert.strictEqual(requests_recv, 3); + assert.strictEqual(requests_sent, 3); });