Skip to content

Commit 59aec82

Browse 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 <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent c35bf44 commit 59aec82

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

+4-4
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)