Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
  • Loading branch information
Trott committed Nov 26, 2016
commit 289f35c3c80cb90e35d99e1fff118ab017e665e2
8 changes: 4 additions & 4 deletions test/parallel/test-http-status-reason-invalid-chars.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const http = require('http');

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

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

function implicit(req, res) {
assert.throws(() => {
res.statusMessage = `OK\r\nContent-Type: text/html\r\n`;
res.statusMessage = 'OK\r\nContent-Type: text/html\r\n';
res.writeHead(200);
}, /Invalid character in statusMessage/);
res.statusMessage = 'OK';
Expand All @@ -37,8 +37,8 @@ const server = http.createServer((req, res) => {
let left = 2;
const check = common.mustCall((res) => {
left--;
assert.notEqual(res.headers['content-type'], 'text/html');
assert.notEqual(res.headers['content-type'], 'gotcha');
assert.notStrictEqual(res.headers['content-type'], 'text/html');
assert.notStrictEqual(res.headers['content-type'], 'gotcha');
if (left === 0) server.close();
}, 2);
http.get(`${url}/explicit`, check).end();
Expand Down