Skip to content

Commit 4c5d24b

Browse files
TrottMylesBorins
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 81d49aa commit 4c5d24b

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const http = require('http');
66

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

1212
assert.throws(() => {
@@ -19,7 +19,7 @@ function explicit(req, res) {
1919

2020
function implicit(req, res) {
2121
assert.throws(() => {
22-
res.statusMessage = `OK\r\nContent-Type: text/html\r\n`;
22+
res.statusMessage = 'OK\r\nContent-Type: text/html\r\n';
2323
res.writeHead(200);
2424
}, /Invalid character in statusMessage/);
2525
res.statusMessage = 'OK';
@@ -37,8 +37,8 @@ const server = http.createServer((req, res) => {
3737
let left = 2;
3838
const check = common.mustCall((res) => {
3939
left--;
40-
assert.notEqual(res.headers['content-type'], 'text/html');
41-
assert.notEqual(res.headers['content-type'], 'gotcha');
40+
assert.notStrictEqual(res.headers['content-type'], 'text/html');
41+
assert.notStrictEqual(res.headers['content-type'], 'gotcha');
4242
if (left === 0) server.close();
4343
}, 2);
4444
http.get(`${url}/explicit`, check).end();

0 commit comments

Comments
 (0)