summaryrefslogtreecommitdiff
path: root/cli/tests/unit/os_test.ts
AgeCommit message (Collapse)Author
2024-06-02fix: validate integer values in `Deno.exitCode` setter (#24068)Kenta Moriuchi
2024-05-29feat: Add `Deno.exitCode` API (#23609)Luke Edwards
This commits adds the ability to set a would-be exit code for the Deno process without forcing an immediate exit, through the new `Deno.exitCode` API. - **Implements `Deno.exitCode` getter and setter**: Adds support for setting and retrieving a would-be exit code via `Deno.exitCode`. This allows for asynchronous cleanup before process termination without immediately exiting. - **Ensures type safety**: The setter for `Deno.exitCode` validates that the provided value is a number, throwing a TypeError if not, to ensure that only valid exit codes are set. Closes to #23605 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-02-10chore: move cli/tests/ -> tests/ (#22369)Matt Mastracci
This looks like a massive PR, but it's only a move from cli/tests -> tests, and updates of relative paths for files. This is the first step towards aggregate all of the integration test files under tests/, which will lead to a set of integration tests that can run without the CLI binary being built. While we could leave these tests under `cli`, it would require us to keep a more complex directory structure for the various test runners. In addition, we have a lot of complexity to ignore various test files in the `cli` project itself (cargo publish exclusion rules, autotests = false, etc). And finally, the `tests/` folder will eventually house the `test_ffi`, `test_napi` and other testing code, reducing the size of the root repo directory. For easier review, the extremely large and noisy "move" is in the first commit (with no changes -- just a move), while the remainder of the changes to actual files is in the second commit.
2024-01-30fix(runtime): return number from `op_ppid` instead of bigint (#22169)Yusuke Tanaka
Fixes #22166
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-01-09feat(runtime/os): add `Deno.env.has()` (#17315)Leo Kettmeir
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-12-27feat(unstable): Add "Deno.osUptime()" API (#17179)Kamil Ogórek
This PR adds support for `Deno.osUptime` which reports number of seconds since os was booted. It will allow us to be compatible with Node's `os.uptime` - https://nodejs.org/api/os.html#osuptime Partially based on https://docs.rs/uptime_lib/latest/src/uptime_lib/lib.rs.html
2022-12-17fix(runtime): `Deno.memoryUsage().rss` should return correct value (#17088)David Sherret
This commit changes implementation of "Deno.memoryUsage()" to return correct value for "rss" field. To do that we implement a specialized function per os to retrieve this information.
2022-12-02chore: rewrite tests and utils to use Deno.Command API (#16895)Bartek Iwańczuk
Since "Deno.spawn()", "Deno.spawnSync()" and "Deno.spawnChild" are getting deprecated, this commits rewrites all tests and utilities to use "Deno.Command" API instead.
2022-11-04fix(runtime): fix Deno.hostname on windows (#16530)Yoshiya Hinosawa
2022-10-26chore(unstable): rename Deno.getUid() and Deno.getGid() (#16432)Colin Ihrig
This commit renames `Deno.getUid()` to `Deno.uid()` and renames `Deno.getGid()` to `Deno.gid()`.
2022-09-28feat: add --allow-sys permission flag (#16028)Yoshiya Hinosawa
2022-09-21fix(runtime): better error message with Deno.env.get/set (#15966)Yoshiya Hinosawa
2022-07-18BREAKING(unstable): Improve Deno.spawn() stdio API (#14919)Nayeem Rahman
- "SpawnOutput" extends "ChildStatus" instead of composing it - "SpawnOutput::stdout", "SpawnOutput::stderr", "Child::stdin", "Child::stdout" and "Child::stderr" are no longer optional, instead made them getters that throw at runtime if that stream wasn't set to "piped". - Remove the complicated "<T extends SpawnOptions = SpawnOptions>" which we currently need to give proper type hints for the availability of these fields. Their typings for these would get increasingly complex if it became dependent on more options (e.g. "SpawnOptions::pty" which if set should make the stdio streams unavailable)
2022-05-31feat(unstable): add Deno.getGid (#14528)James Bradlee
2022-05-18refactor: use spawn API across codebase (#14414)Leo Kettmeir
2022-01-31feat(unstable): add Deno.getUid (#13496)Yoshiya Hinosawa
2022-01-20chore: update copyright year (#13434)Yoshiya Hinosawa
2021-11-23refactor: remove "unitTest" wrapper from cli/tests/unit (#12750)Bartek Iwańczuk
2021-09-23test(cli): align unit test permissions with runtime test permissions (#12189)Casper Beyer
2021-08-05refactor(cli/tests): remove unnecessary void return types (#11577)Leo K
2021-07-29feat(runtime): implement navigator.hardwareConcurrency (#11448)Divy Srivastava
This commit implements "navigator.hardwareConcurrency" API, which supersedes "Deno.systemCpuInfo()" API (which was removed in this commit).
2021-03-17refactor: clean up permission handling (#9367)crowlKats
2021-02-23fix: panic caused by Deno.env.set("", "") (#9583)Kohei Ueno
2021-01-11chore: update copyright to 2021 (#9092)Yusuke Tanaka
2020-10-26feat(unstable): add Deno.systemCpuInfo() (#7774)Elias Sjögreen
2020-09-14test(cli/tests/unit): Enable color for js_unit_tests (#7443)Nayeem Rahman
2020-09-10feat(unstable): Add Deno.systemMemoryInfo() (#7350)Akshat Agarwal
Co-authored-by: marcopacini <pacinim88@gmail.com> Co-authored-by: Casper Beyer <caspervonb@pm.me>
2020-07-14Use dprint for internal formatting (#6682)David Sherret
2020-07-08feat(unstable): Deno.ppid (#6539)uki00a
2020-06-25refactor(cli/tests/unit) to use assertThrows (#6459)Casper Beyer
2020-06-20Remove Deno.dir and dirs dependency (#6385)Ryan Dahl
2020-06-12Revert "feat: add Deno.osName()" (#6261)Ryan Dahl
Deno.build.os provides the same functionality This reverts commit 6ccf9037a6b36c81ea0e6ac12d0e2dbd793f6114.
2020-06-11feat: add Deno.osName() (#5714)Rubin Bhandari
2020-06-09feat(cli): Add Deno.env.delete() (#5859)Tuan Le
2020-05-29fix(cli/permissions): Fix CWD and exec path leaks (#5642)Nayeem Rahman
2020-05-20move js unit tests to cli/tests (#5678)Ryan Dahl