diff options
author | Satya Rohith <me@satyarohith.com> | 2024-02-23 22:00:29 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-23 17:30:29 +0100 |
commit | 47dee65e4ad20847108d2f7e590c001ca9b93204 (patch) | |
tree | c6c02343e50486ec4c7f7ddd5ee6ce2ad6249865 /tests/unit_node/process_test.ts | |
parent | cddefecfff38215cef509aa6c0a2119682b49c15 (diff) |
fix(ext/node): set correct process.argv0 (#22555)
Diffstat (limited to 'tests/unit_node/process_test.ts')
-rw-r--r-- | tests/unit_node/process_test.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts index 24ef6a316..0bbc9981f 100644 --- a/tests/unit_node/process_test.ts +++ b/tests/unit_node/process_test.ts @@ -287,7 +287,17 @@ Deno.test({ Deno.test({ name: "process.argv0", - fn() { + async fn() { + const { stdout } = await new Deno.Command(Deno.execPath(), { + args: [ + "eval", + `import process from "node:process";console.log(process.argv0);`, + ], + stdout: "piped", + stderr: "null", + }).output(); + assertEquals(new TextDecoder().decode(stdout).trim(), Deno.execPath()); + assertEquals(typeof process.argv0, "string"); assert( process.argv0.match(/[^/\\]*deno[^/\\]*$/), |