Skip to content

Commit

Permalink
test: fix strictEqual() arguments order
Browse files Browse the repository at this point in the history
PR-URL: #23800
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
  • Loading branch information
Nolan Rigo authored and rvagg committed Nov 28, 2018
1 parent 3f2a016 commit 3a864d7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/parallel/test-http-upgrade-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -157,8 +157,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();
});

Expand All @@ -180,7 +180,7 @@ 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);
assert.ok(test_upgrade_no_listener_ended);
});

0 comments on commit 3a864d7

Please sign in to comment.