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:
LiviaMedeiros authored and Danielle Adams committed 2022-07-25 21:43:31 -04:00
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();
}));
}));