Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ee8fa52

Browse filesBrowse files
Nolan Rigotargos
authored andcommitted
test: fix strictEqual() arguments order
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>
1 parent 9fbe91a commit ee8fa52
Copy full SHA for ee8fa52

File tree

Expand file treeCollapse file tree

1 file changed

+9
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-9
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-http-upgrade-server.js
+9-9Lines changed: 9 additions & 9 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.