summaryrefslogtreecommitdiff
path: root/cli/tests/unit
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-02-09chore: completely disable websocketstream_test (#22360)Matt Mastracci
2024-02-08chore(cli): disable some of the restored WSS tests (#22357)Matt Mastracci
2024-02-08chore: Promote some integration tests to js_unit_tests (#22355)Matt Mastracci
- Move a workers test to js_unit_tests and make it work - (slightly) repair the websocketstream_test and make it a JS unit test. This test was being ignored and rotted quite a bit, but there's some value in running as much of it as we can. - Merge the two websocket test files
2024-02-07chore(cli): Use @test_util for relative path for unit tests (#22327)Matt Mastracci
This removes the majority of `../../../../../../test_util` relative imports from the codebase, allowing us to move this code more easily in the future.
2024-02-07fix: enable "--allow-sys=cpus" for "deno run" (#22260)restlessronin
Fixes #22221 with the suggested fix, and added "cpus" to the existing tests.
2024-02-07chore: remove op_spawn_child test (#22314)Bartek Iwańczuk
This test is not needed because the op is not available to user code anymore. This brings number of ops exposed to user code down to 15.
2024-02-07chore: don't expose FFI ops to user code (#22313)Bartek Iwańczuk
This commit removes some not really necessary FFI tests and in effect removes them from being accessible from the user code. This lowers the number of ops accessible to user code to 16.
2024-02-07chore: upgrade deno_core to 0.259.0 (#22311)Bartek Iwańczuk
This update brings number of ops available to user code down to 45.
2024-02-07chore: remove unneeded benchmark (#22300)Bartek Iwańczuk
Brings down the number of ops available to user code to 49.
2024-02-06fix: Support Symbol.metadata (#22282)Bartek Iwańczuk
This commit adds support for "Symbol.metadata" which was omitted when adding support for the Decorators Proposal. Closes https://github.com/denoland/deno/issues/22111
2024-02-06chore(ws): remove unused op_ws_send_pong (#22283)Divy Srivastava
2024-02-06refactor: don't expose some ops (#22281)Bartek Iwańczuk
This commit brings down the number of ops exposed to user code to 51.
2024-02-06refactor: don't expose ops to user code (#22273)Bartek Iwańczuk
Brings the number of ops exposed to user code down to 58.
2024-02-05refactor(cli): Move op descriptions into Rust and prepare for op import (#22271)Matt Mastracci
This moves the op sanitizer descriptions into Rust code and prepares for eventual op import from `ext:core/ops`. We cannot import these ops from `ext:core/ops` as the testing infrastructure ops are not always present. Changes: - Op descriptions live in `cli` code and are currently accessible via an op for the older sanitizer code - `phf` dep moved to workspace root so we can use it here - `ops.op_XXX` changed to to `op_XXX` to prepare for op imports later on.
2024-02-06fix(unstable): validate kv list selector (#22265)Heyang Zhou
Check that in a `KvListSelector`, `start` and `end` are actually within the keyspace bounds defined by `prefix`, if both are present.
2024-02-05feat(unstable): `Deno.FsFile.lock[Sync]()` and `Deno.FsFile.unlock[Sync]()` ↵Asher Gomez
(#22235) Closes #22178.
2024-02-04chore: remove opcall_test.ts (#22227)Bartek Iwańczuk
This test should be in `deno_core`. Ref https://github.com/denoland/deno_core/issues/533
2024-02-01fix(fs): copyFile NUL path on macOS (#22216)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/22211
2024-01-31refactor: remove imported ops from Deno.core.ops (#22194)Bartek Iwańczuk
This commit adds a list of ops to `runtime/99_main.js` that are currently relying on getting them from `Deno.core.ops`. All ops that are not present in the list are removed from `Deno.core.ops` on startup (they are imported from "virtual op module" - `ext:core/ops`) making them effectively inaccessible to user code. This change lowers the number of ops exposed to user code from 650 to around 260. This number should be gradually decreased in follow-up PRs.
2024-01-30fix(runtime): return number from `op_ppid` instead of bigint (#22169)Yusuke Tanaka
Fixes #22166
2024-01-27feat(unstable): implement `navigator.gpu.getPreferredCanvasFormat()` (#22149)Divy Srivastava
2024-01-26fix(ext/http): smarter handling of Accept-Encoding (#22130)Matt Mastracci
2024-01-25fix(fs): instanceof check for Deno.FsFile (#22121)Bartek Iwańczuk
Regression caused by https://github.com/denoland/deno/pull/22072. I added a relevant test so we don't regress again. Fixes https://github.com/denoland/deno/issues/22115
2024-01-24revert: Remove deprecations of file sync APIs (#22085)Bartek Iwańczuk
- `Deno.FsFile.dataSync` -> `Deno.FsFile.syncData` - `Deno.FsFile.dataSyncSync` -> `Deno.FsFile.syncDataSync` Also marks these APIs as unstable
2024-01-24feat: `Deno.FsFile.{utime,utimeSync}()` and deprecate ↵Asher Gomez
`Deno.{futime,futimeSync}` (#22070) For removal in Deno v2. --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-24chore: fix `Deno.UnsafeWindowSurface` typings (#22081)Dean Srebnik
- changed `Deno.UnsafeWindowSurface` typings from accepting `Deno.UnsafePointerView` to `Deno.PointerValue` - added width and height to `GPUCanvasConfiguration`
2024-01-24feat: deprecate `Deno.write()` and `Deno.writeSync()` (#22064)Asher Gomez
For removal in Deno v2.
2024-01-24feat: deprecate `Deno.close()` (#22066)Asher Gomez
For removal in Deno v2. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-24feat: deprecate `Deno.ftruncate()` and `Deno.ftruncateSync()` (#22069)Asher Gomez
For removal in Deno 2.0.
2024-01-24fix(ext/cron): automatically override unspecified values (#22042)Igor Zinkovsky
Fixes #22041
2024-01-24feat: `FsFile.sync()` and `FsFile.syncSync()` (#22017)Asher Gomez
This change: 1. Implements `Deno.FsFile.sync()` and `Deno.FsFile.syncSync()`. 2. Deprecates `Deno.fsync()` and `Deno.fsyncSync()` for removal in Deno v2, in favour of the above corresponding methods. Related #21995 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-24feat: `Deno.FsFile.dataSync()` and `Deno.FsFile.dataSyncSync()` (#22019)Asher Gomez
This change: 1. Implements `Deno.FsFile.dataSync()` and `Deno.FsFile.dataSyncSync()`. 2. Deprecates `Deno.fdatasync()` and `Deno.fdatasyncSync()` for removal in Deno v2, in favour of the above corresponding methods. 3. Replaces use of `Deno.fdatasync()` and `Deno.fdatasyncSync()` with the above instance methods. Related #21995
2024-01-24feat: deprecate `Deno.resources()` (#22059)Asher Gomez
Most uses of `Deno.resources()` within tests, as they previously checked for leaked resources. This is not needed as the test runner does this automatically. Other internal uses of this API have been replaced with the internal `Deno[Deno.internal].core.resources()`.
2024-01-24feat: `Deno.{stdin,stdout,stderr}.isTerminal()`, deprecate `Deno.isatty()` ↵Asher Gomez
(#22011) This change: 1. Implements `Deno.stdin.isTerminal()`, `Deno.stdout.isTerminal()` and `Deno.stderr.isTerminal()`. 2. Deprecates `Deno.isatty()` for removal in Deno v2, in favour of the above instance methods. 3. Replaces use of `Deno.isatty()` with the above instance methods. Related #21995 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-01-23refactor: set removal version for `Deno.ListenTlsOptions.certFile`, ↵Asher Gomez
`Deno.ListenTlsOptions.keyFile` and `Deno.ConnectTlsOptions.certFile` (#22026) This change: 1. Sets the removal version for `Deno.ListenTlsOptions.certFile`, `Deno.ListenTlsOptions.keyFile` and `Deno.ConnectTlsOptions.certFile` for Deno v2, in favour of the `cert`, `key` and `caCerts` options, respectively. 2. Replaces use of the deprecated options with the new recommended options. Towards #22021
2024-01-23chore: use ensureFastOps in 02_surface.js (#22045)Divy Srivastava
2024-01-23BREAKING(unstable): remove `Deno.cron()` overload (#22035)Asher Gomez
This change removes the currently deprecated `Deno.cron()` overload with `options` as a potential last argument. This might be fine to do now, in a major release, as `Deno.cron()` is an unstable API. I thought of doing this while working on #22021. If this is not ready to remove, I can instead set the removal version of this overload for Deno v2. Note: this overload was deprecated in Deno v1.38.2 (#21225). So it's been deprecated for over 2 months.
2024-01-23refactor: set removal version for `Deno.Server` (#22024)Asher Gomez
This change sets the removal version for the deprecated `Deno.Server` interface for Deno 2.0. Towards #22021
2024-01-22feat(unstable): remove Deno.upgradeHttp API (#21856)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/21828. This API is a huge footgun. And given that "Deno.serveHttp" is a deprecated API that is discouraged to use (use "Deno.serve()" instead); it makes no sense to keep this API around. This is a step towards fully migrating to Hyper 1.
2024-01-22feat(web): ImageBitmap (#21898)Leo Kettmeir
2024-01-22chore: use `FsFile[Symbol.dispose]()` (#22007)Asher Gomez
This change takes advantage of explicit resources management for `FsFile` instances and tweaks documentation to encourage the use of it. --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-01-21chore: use `Deno.readTextFile()` where appropriate (#22018)Asher Gomez
2024-01-21chore: use `Deno.writeTextFile()` where appropriate (#22008)Asher Gomez
2024-01-21chore: add types for `Deno.UnsafeWindowSurface` (#22010)Divy Srivastava
2024-01-15chore(ext/cache): remove CachePutResource in preparation for resource ↵Matt Mastracci
rewrite (#21949) We can use `resourceForReadableStream` to ensure that cached resources are implemented more efficiently and remove one more resource special case.
2024-01-14chore: upgrade deno_core to 0.246.0 (#21904)Bartek Iwańczuk
2024-01-09fix(ext/websocket): pass on uncaught errors in idleTimeout (#21846)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/21840 The problem was hard to reproduce as its a race condition. I've added a test that reproduces the problem 1/10 tries. We should move the idleTimeout handling to Rust (maybe even built into fastwebsocket).