From 962f061d39c6149ea58af2fc0009223170c6e0e6 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 --- 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);