From 78c7118ab774ef0597f55b2bf022010b3a731381 Mon Sep 17 00:00:00 2001 From: Shubham Chaturvedi <19shubham11@gmail.com> Date: Tue, 12 Nov 2019 15:34:47 +0000 Subject: [PATCH] test: use spread instead of object.assign PR-URL: https://github.com/nodejs/node/pull/30412 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Ruben Bridgewater Reviewed-By: Trivikram Kamat --- test/parallel/test-child-process-fork-args.js | 2 +- test/parallel/test-child-process-fork-exec-path.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-child-process-fork-args.js b/test/parallel/test-child-process-fork-args.js index 7c86616f3750c6..f2f5689d64d6ba 100644 --- a/test/parallel/test-child-process-fork-args.js +++ b/test/parallel/test-child-process-fork-args.js @@ -64,7 +64,7 @@ const expectedEnv = { foo: 'bar' }; argsLists.forEach((args) => { const cp = fork(fixtures.path('child-process-echo-options.js'), args, { - env: Object.assign({}, process.env, expectedEnv) + env: { ...process.env, ...expectedEnv } }); cp.on( diff --git a/test/parallel/test-child-process-fork-exec-path.js b/test/parallel/test-child-process-fork-exec-path.js index 6a99c5a8f55d62..38adfd72de4298 100644 --- a/test/parallel/test-child-process-fork-exec-path.js +++ b/test/parallel/test-child-process-fork-exec-path.js @@ -51,7 +51,7 @@ assert.strictEqual(fs.existsSync(copyPath), false); fs.copyFileSync(nodePath, copyPath, fs.constants.COPYFILE_FICLONE); fs.chmodSync(copyPath, '0755'); -const envCopy = Object.assign({}, process.env, { 'FORK': 'true' }); +const envCopy = { ...process.env, FORK: 'true' }; const child = fork(__filename, { execPath: copyPath, env: envCopy }); child.on('message', common.mustCall(function(recv) { assert.deepStrictEqual(recv, msg);