From 8a9b2b616857589d35d85bb7b77e60a6d077c506 Mon Sep 17 00:00:00 2001 From: Jared Haines Date: Fri, 12 Oct 2018 09:17:17 -0700 Subject: [PATCH] test: fix order of values in test assertions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Have actual first, expected second. PR-URL: https://github.com/nodejs/node/pull/23450 Reviewed-By: Gireesh Punathil Reviewed-By: Tobias Nießen Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat Reviewed-By: Sakthipriyan Vairamani --- test/parallel/test-http-server.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/parallel/test-http-server.js b/test/parallel/test-http-server.js index 567f2b3b31b83b..d46e25bdf6c558 100644 --- a/test/parallel/test-http-server.js +++ b/test/parallel/test-http-server.js @@ -37,23 +37,23 @@ const server = http.createServer(function(req, res) { req.id = request_number++; if (req.id === 0) { - assert.strictEqual('GET', req.method); - assert.strictEqual('/hello', url.parse(req.url).pathname); - assert.strictEqual('world', qs.parse(url.parse(req.url).query).hello); - assert.strictEqual('b==ar', qs.parse(url.parse(req.url).query).foo); + assert.strictEqual(req.method, 'GET'); + assert.strictEqual(url.parse(req.url).pathname, '/hello'); + assert.strictEqual(qs.parse(url.parse(req.url).query).hello, 'world'); + assert.strictEqual(qs.parse(url.parse(req.url).query).foo, 'b==ar'); } if (req.id === 1) { - assert.strictEqual('POST', req.method); - assert.strictEqual('/quit', url.parse(req.url).pathname); + assert.strictEqual(req.method, 'POST'); + assert.strictEqual(url.parse(req.url).pathname, '/quit'); } if (req.id === 2) { - assert.strictEqual('foo', req.headers['x-x']); + assert.strictEqual(req.headers['x-x'], 'foo'); } if (req.id === 3) { - assert.strictEqual('bar', req.headers['x-x']); + assert.strictEqual(req.headers['x-x'], 'bar'); this.close(); } @@ -112,8 +112,8 @@ server.on('listening', function() { }); process.on('exit', function() { - assert.strictEqual(4, request_number); - assert.strictEqual(4, requests_sent); + assert.strictEqual(request_number, 4); + assert.strictEqual(requests_sent, 4); const hello = new RegExp('/hello'); assert.ok(hello.test(server_response)); @@ -121,5 +121,5 @@ process.on('exit', function() { const quit = new RegExp('/quit'); assert.ok(quit.test(server_response)); - assert.strictEqual(true, client_got_eof); + assert.strictEqual(client_got_eof, true); });