Skip to content

Commit ea0cfc9

Browse files
Cesar-M-DiazRafaelGSS
authored andcommitted
test: add test to improve coverage in http2-compat-serverresponse
PR-URL: #44970 Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Adrian Estrada <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 4825786 commit ea0cfc9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/parallel/test-http2-compat-serverresponse-write.js

+18
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,21 @@ const assert = require('assert');
7171
}));
7272
}));
7373
}
74+
75+
{
76+
const server = createServer();
77+
server.listen(0, mustCall(() => {
78+
const port = server.address().port;
79+
const url = `http://localhost:${port}`;
80+
const client = connect(url, mustCall(() => {
81+
client.request();
82+
}));
83+
84+
server.once('request', mustCall((request, response) => {
85+
response.destroy();
86+
assert.strictEqual(response.write('asd', mustNotCall()), false);
87+
client.destroy();
88+
server.close();
89+
}));
90+
}));
91+
}

0 commit comments

Comments
 (0)