Skip to content

Commit

Permalink
test: fix misplaced ) in http response statuscode test
Browse files Browse the repository at this point in the history
This fixes a misplaced parenthesis in each of the tests in
test/parallel/test-http-response-statuscodes.js, causing the tests to
pass as long as any error was thrown, without validating the error
message.

PR-URL: #10692
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michal Zasso <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
nfriedly authored and italoacasas committed Jan 27, 2017
1 parent 4c8676b commit e408f0a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/parallel/test-http-response-statuscode.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,62 +11,62 @@ const server = http.Server(common.mustCall(function(req, res) {
case 0:
assert.throws(common.mustCall(() => {
res.writeHead(-1);
}, /invalid status code/i));
}), /invalid status code/i);
break;
case 1:
assert.throws(common.mustCall(() => {
res.writeHead(Infinity);
}, /invalid status code/i));
}), /invalid status code/i);
break;
case 2:
assert.throws(common.mustCall(() => {
res.writeHead(NaN);
}, /invalid status code/i));
}), /invalid status code/i);
break;
case 3:
assert.throws(common.mustCall(() => {
res.writeHead({});
}, /invalid status code/i));
}), /invalid status code/i);
break;
case 4:
assert.throws(common.mustCall(() => {
res.writeHead(99);
}, /invalid status code/i));
}), /invalid status code/i);
break;
case 5:
assert.throws(common.mustCall(() => {
res.writeHead(1000);
}, /invalid status code/i));
}), /invalid status code/i);
break;
case 6:
assert.throws(common.mustCall(() => {
res.writeHead('1000');
}, /invalid status code/i));
}), /invalid status code/i);
break;
case 7:
assert.throws(common.mustCall(() => {
res.writeHead(null);
}, /invalid status code/i));
}), /invalid status code/i);
break;
case 8:
assert.throws(common.mustCall(() => {
res.writeHead(true);
}, /invalid status code/i));
}), /invalid status code/i);
break;
case 9:
assert.throws(common.mustCall(() => {
res.writeHead([]);
}, /invalid status code/i));
}), /invalid status code/i);
break;
case 10:
assert.throws(common.mustCall(() => {
res.writeHead('this is not valid');
}, /invalid status code/i));
}), /invalid status code/i);
break;
case 11:
assert.throws(common.mustCall(() => {
res.writeHead('404 this is not valid either');
}, /invalid status code/i));
}), /invalid status code/i);
this.close();
break;
default:
Expand Down

0 comments on commit e408f0a

Please sign in to comment.