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 59aec82

Browse filesBrowse files
Trottaddaleax
authored andcommitted
test: refine test-http-status-reason-invalid-chars
* replace unneeded template strings with strings; there was no variable substitution or concatenation or anything like that * assert.notEqual() -> assert.notStrictEqual() PR-URL: #9802 Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent c35bf44 commit 59aec82
Copy full SHA for 59aec82

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎test/parallel/test-http-status-reason-invalid-chars.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-status-reason-invalid-chars.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const net = require('net');
77

88
function explicit(req, res) {
99
assert.throws(() => {
10-
res.writeHead(200, `OK\r\nContent-Type: text/html\r\n`);
10+
res.writeHead(200, 'OK\r\nContent-Type: text/html\r\n');
1111
}, /Invalid character in statusMessage/);
1212

1313
assert.throws(() => {
@@ -20,7 +20,7 @@ function explicit(req, res) {
2020

2121
function implicit(req, res) {
2222
assert.throws(() => {
23-
res.statusMessage = `OK\r\nContent-Type: text/html\r\n`;
23+
res.statusMessage = 'OK\r\nContent-Type: text/html\r\n';
2424
res.writeHead(200);
2525
}, /Invalid character in statusMessage/);
2626
res.statusMessage = 'OK';
@@ -40,8 +40,8 @@ const server = http.createServer((req, res) => {
4040
let left = 2;
4141
const check = common.mustCall((res) => {
4242
left--;
43-
assert.notEqual(res.headers['content-type'], 'text/html');
44-
assert.notEqual(res.headers['content-type'], 'gotcha');
43+
assert.notStrictEqual(res.headers['content-type'], 'text/html');
44+
assert.notStrictEqual(res.headers['content-type'], 'gotcha');
4545
if (left === 0) server.close();
4646
}, 2);
4747
http.get(`${url}/explicit`, check).end();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.