mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
test: use common.mustNotMutateObjectDeep() in immutability tests
PR-URL: https://github.com/nodejs/node/pull/43196 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
1 parent
42f2deb3a0
commit
776cc3abbd
3 files changed
+8
-9
No files matched your search
@@ -139,19 +139,16 @@ function createServer() {
|
||||
server.listen(0, common.mustCall(() => {
|
||||
const port = server.address().port;
|
||||
const host = 'localhost';
|
||||
const options = {
|
||||
const options = common.mustNotMutateObjectDeep({
|
||||
port: 3000,
|
||||
rejectUnauthorized: false
|
||||
};
|
||||
rejectUnauthorized: false,
|
||||
});
|
||||
|
||||
const socket = agent.createConnection(port, host, options);
|
||||
socket.on('connect', common.mustCall((data) => {
|
||||
socket.end();
|
||||
}));
|
||||
socket.on('end', common.mustCall(() => {
|
||||
assert.deepStrictEqual(options, {
|
||||
port: 3000, rejectUnauthorized: false
|
||||
});
|
||||
server.close();
|
||||
}));
|
||||
}));
|
||||
|
||||
Reference in new issue
Block a user