diff options
author | Yusuke Tanaka <yusuktan@maguro.dev> | 2024-02-01 12:48:27 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-01 09:18:27 +0530 |
commit | 66e6ed65e9c9281a68b548ab01a2214d5a0aa1e3 (patch) | |
tree | 3a1a48da5d52ce631ce40cc9d2e3fc511861f959 /cli/tests/unit_node/process_test.ts | |
parent | cfb57b18555c34d3e9cde538d003984e058559bd (diff) |
fix(node): add `ppid` getter for `node:process` (#22167)
This commit adds `ppid` getter for `node:process` to improve Node
compatibility one step further.
There is one problem though, which is that `Deno.ppid`, which
`process.ppid` internally calls, is actually of type `bigint` although
it's supposed to be `number`. I filed an issue for this (#22166). For
the time being, explciit type conversion from `bigint` to `number` is
applied to match the Node.js behavior.
Diffstat (limited to 'cli/tests/unit_node/process_test.ts')
-rw-r--r-- | cli/tests/unit_node/process_test.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/tests/unit_node/process_test.ts b/cli/tests/unit_node/process_test.ts index 23bf73864..21f873260 100644 --- a/cli/tests/unit_node/process_test.ts +++ b/cli/tests/unit_node/process_test.ts @@ -122,6 +122,14 @@ Deno.test({ }); Deno.test({ + name: "process.ppid", + fn() { + assertEquals(typeof process.ppid, "number"); + assertEquals(process.ppid, Deno.ppid); + }, +}); + +Deno.test({ name: "process.on", async fn() { assertEquals(typeof process.on, "function"); |