diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-03-25 08:17:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-25 08:17:13 -0400 |
commit | 4691bde42935582a217ce1453d4c8a495ed4af86 (patch) | |
tree | e90ef2d3089977204d87be102a0b71cf5f62c8c3 /cli/tests/unit/process_test.ts | |
parent | 84b1acf8baf34d8651b4d0e871072b40f321737f (diff) |
fix: `Deno.run` - do not modify user provided `cmd` array (#14109)
Diffstat (limited to 'cli/tests/unit/process_test.ts')
-rw-r--r-- | cli/tests/unit/process_test.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/tests/unit/process_test.ts b/cli/tests/unit/process_test.ts index 3ef19a879..e4e2cc3c5 100644 --- a/cli/tests/unit/process_test.ts +++ b/cli/tests/unit/process_test.ts @@ -21,7 +21,12 @@ Deno.test( { permissions: { run: true, read: true } }, async function runSuccess() { const p = Deno.run({ - cmd: [Deno.execPath(), "eval", "console.log('hello world')"], + // freeze the array to ensure it's not modified + cmd: Object.freeze([ + Deno.execPath(), + "eval", + "console.log('hello world')", + ]), stdout: "piped", stderr: "null", }); |