Skip to content

Commit 5b59e8a

Browse files
Nolan Rigorvagg
Nolan Rigo
authored andcommitted
test: fix strictEqual() arguments order
PR-URL: #23800 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Shelley Vohr <[email protected]>
1 parent a7c57b6 commit 5b59e8a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/parallel/test-http-upgrade-server.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,20 @@ function test_upgrade_with_listener() {
9898
conn.on('data', function(data) {
9999
state++;
100100

101-
assert.strictEqual('string', typeof data);
101+
assert.strictEqual(typeof data, 'string');
102102

103103
if (state === 1) {
104-
assert.strictEqual('HTTP/1.1 101', data.substr(0, 12));
105-
assert.strictEqual('WjN}|M(6', request_upgradeHead.toString('utf8'));
104+
assert.strictEqual(data.substr(0, 12), 'HTTP/1.1 101');
105+
assert.strictEqual(request_upgradeHead.toString('utf8'), 'WjN}|M(6');
106106
conn.write('test', 'utf8');
107107
} else if (state === 2) {
108-
assert.strictEqual('test', data);
108+
assert.strictEqual(data, 'test');
109109
conn.write('kill', 'utf8');
110110
}
111111
});
112112

113113
conn.on('end', function() {
114-
assert.strictEqual(2, state);
114+
assert.strictEqual(state, 2);
115115
conn.end();
116116
server.removeAllListeners('upgrade');
117117
test_upgrade_no_listener();
@@ -156,8 +156,8 @@ function test_standard_http() {
156156
});
157157

158158
conn.once('data', function(data) {
159-
assert.strictEqual('string', typeof data);
160-
assert.strictEqual('HTTP/1.1 200', data.substr(0, 12));
159+
assert.strictEqual(typeof data, 'string');
160+
assert.strictEqual(data.substr(0, 12), 'HTTP/1.1 200');
161161
conn.end();
162162
});
163163

@@ -179,6 +179,6 @@ server.listen(0, function() {
179179
Fin.
180180
-----------------------------------------------*/
181181
process.on('exit', function() {
182-
assert.strictEqual(3, requests_recv);
183-
assert.strictEqual(3, requests_sent);
182+
assert.strictEqual(requests_recv, 3);
183+
assert.strictEqual(requests_sent, 3);
184184
});

0 commit comments

Comments
 (0)