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 9d9ad81

Browse filesBrowse files
juanarbolruyadorno
authored andcommitted
test: improve test coverage for ServerResponse
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com> PR-URL: #55711 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name>
1 parent cefce4c commit 9d9ad81
Copy full SHA for 9d9ad81

1 file changed

+9-1Lines changed: 9 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-http-write-head.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-write-head.js
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ const s = http.createServer(common.mustCall((req, res) => {
5151
}
5252
);
5353

54+
assert.throws(() => {
55+
res.writeHead(200, ['invalid', 'headers', 'args']);
56+
}, {
57+
code: 'ERR_INVALID_ARG_VALUE'
58+
});
59+
5460
res.writeHead(200, { Test: '2' });
5561

5662
assert.throws(() => {
@@ -78,7 +84,9 @@ function runTest() {
7884

7985
{
8086
const server = http.createServer(common.mustCall((req, res) => {
81-
res.writeHead(200, [ 'test', '1' ]);
87+
res.writeHead(220, [ 'test', '1' ]); // 220 is not a standard status code
88+
assert.strictEqual(res.statusMessage, 'unknown');
89+
8290
assert.throws(() => res.writeHead(200, [ 'test2', '2' ]), {
8391
code: 'ERR_HTTP_HEADERS_SENT',
8492
name: 'Error',

0 commit comments

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