diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/dts/lib.deno.ns.d.ts | 2 | ||||
-rw-r--r-- | cli/tests/unit/process_test.ts | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index 02f514673..d55ac231e 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -2398,7 +2398,7 @@ declare namespace Deno { export interface RunOptions { /** Arguments to pass. Note, the first element needs to be a path to the * binary */ - cmd: string[] | [URL, ...string[]]; + cmd: readonly string[] | [URL, ...string[]]; cwd?: string; env?: { [key: string]: string; 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", }); |