diff --git a/test/parallel/test-fs-options-immutable.js b/test/parallel/test-fs-options-immutable.js index 77ce3ebf1de..dfe05a96ef7 100644 --- a/test/parallel/test-fs-options-immutable.js +++ b/test/parallel/test-fs-options-immutable.js @@ -9,7 +9,7 @@ const common = require('../common'); const fs = require('fs'); const path = require('path'); -const options = Object.freeze({}); +const options = common.mustNotMutateObjectDeep({}); const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); diff --git a/test/parallel/test-https-agent-create-connection.js b/test/parallel/test-https-agent-create-connection.js index cea335a422e..1ac2c840b0d 100644 --- a/test/parallel/test-https-agent-create-connection.js +++ b/test/parallel/test-https-agent-create-connection.js @@ -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(); })); })); diff --git a/test/parallel/test-https-argument-of-creating.js b/test/parallel/test-https-argument-of-creating.js index 6f1564826ea..fe6ca9f59a6 100644 --- a/test/parallel/test-https-argument-of-creating.js +++ b/test/parallel/test-https-argument-of-creating.js @@ -12,11 +12,13 @@ const dftProtocol = {}; // Test for immutable `opts` { - const opts = { foo: 'bar', ALPNProtocols: [ 'http/1.1' ] }; + const opts = common.mustNotMutateObjectDeep({ + foo: 'bar', + ALPNProtocols: [ 'http/1.1' ], + }); const server = https.createServer(opts); tls.convertALPNProtocols([ 'http/1.1' ], dftProtocol); - assert.deepStrictEqual(opts, { foo: 'bar', ALPNProtocols: [ 'http/1.1' ] }); assert.strictEqual(server.ALPNProtocols.compare(dftProtocol.ALPNProtocols), 0); }