summaryrefslogtreecommitdiff
path: root/cli/tests/unit
AgeCommit message (Collapse)Author
2023-06-27fix(kv): assertReject should always be awaited (#19612)Heyang Zhou
2023-06-26chore: fix typos (#19572)Martin Fischer
2023-06-24fix(cli): Don't use hardcoded port 4501 in serve test (#19599)Matt Mastracci
2023-06-17chore(kv) fix and re-enable queue test (#19529)Igor Zinkovsky
The callback draining code is no longer needed after #19513.
2023-06-15chore(ext/kv): disable flaky test (#19522)Heyang Zhou
2023-06-15chore(ext/net): ignore startTls test (#19515)Matt Mastracci
2023-06-14chore(kv) another fix for queue flaky test (#19513)Igor Zinkovsky
2023-06-14chore(kv) fix flaky queue test (#19495)Igor Zinkovsky
2023-06-13feat(kv) queue implementation (#19459)Igor Zinkovsky
Extend the unstable `Deno.Kv` API to support queues.
2023-06-13fix(ext/http): replace await Deno.serve with await Deno.serve().finished ↵Matt Mastracci
(#19485) We have a bunch of these to clean up after we changed the API.
2023-06-13fix(ext/websockets): ensure we fully send frames before close (#19484)Matt Mastracci
Fixes #19483
2023-06-12chore(core): fix flaky flock_test on windows (#19477)Matt Mastracci
2023-06-08chore: Use relative paths for assert imports to avoid test flakes (#19427)Matt Mastracci
Tests occasionally fail if we get a bad gateway attempting to fetch the assertion module
2023-06-08perf(ext/websocket): Reduce GC pressure & monomorpize op_ws_next_event (#19405)Matt Mastracci
Reduce the GC pressure from the websocket event method by splitting it into an event getter and a buffer getter. Before: 165.9k msg/sec After: 169.9k msg/sec
2023-06-06fix(ext/console): fix inspecting large ArrayBuffers (#19373)ud2
2023-06-05feat: add more options to Deno.inspect (#19337)Leo Kettmeir
For https://github.com/denoland/deno_std/issues/3404 --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-06-04fix(ext/web): Copy EventTarget list before dispatch (#19360)Koen
Related issue: https://github.com/denoland/deno/issues/19358. This is a regression that seems to have been introduced in https://github.com/denoland/deno/pull/18905. It looks to have been a performance optimization. The issue is probably easiest described with some code: ```ts const target = new EventTarget(); const event = new Event("foo"); target.addEventListener("foo", () => { console.log('base'); target.addEventListener("foo", () => { console.log('nested'); }); }); target.dispatchEvent(event); ``` Essentially, the second event listener is being attached while the `foo` event is still being dispatched. It should then not fire that second event listener, but Deno currently does.
2023-05-31refactor(ext/http): Expose internal serveHttpOnListener API for HTTP2 (#19331)Matt Mastracci
For the first implementation of node:http2, we'll use the internal version of `Deno.serve` which allows us to listen on a raw TCP connection rather than a listener. This is mostly a refactoring, and hooking up of `op_http_serve_on` that was never previously exposed (but designed for this purpose).
2023-05-24feat(ext/fs): add isBlockDevice, isCharDevice, isFifo, isSocket to FileInfo ↵Hirotaka Tagawa / wafuwafu13
(#19008) `isFile`, `isDirectory`, `isSymlink` are defined in `Deno.FileInfo`, but `isBlockDevice`, `isCharacterDevice`, `isFIFO`, `isSocket` are not defined. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-24chore(core): Ensure that net test ports aren't used elsewhere (#19243)Matt Mastracci
Fixes occasional test flake due to overlapping ports
2023-05-24feat(ext/http): Brotli Compression (#19216)Levente Kurusa
Add Brotli streaming compression to HTTP
2023-05-22chore(cli): One Rust test per JS and Node unit test file (#19199)Matt Mastracci
This runs our `js_unit_tests` and `node_unit_tests` in parallel, one rust test per JS unit test file. Some of our JS tests don't like running in parallel due to port requirements, so this also makes those use a specific port-per-file. This does not attempt to make the node-compat tests work.
2023-05-22fix(ext/web): improve timers resolution for 0ms timeouts (#19212)Bartek Iwańczuk
This commit changes the implementation of `ext/web` timers, by using "op_void_async_deferred" for timeouts of 0ms. 0ms timeout is meant to be run at the end of the event loop tick and currently Tokio timers that we use to back timeouts have at least 1ms resolution. That means that 0ms timeout actually take >1ms. This commit changes that and runs 0ms timeout at the end of the event loop tick. One consequence is that "unrefing" a 0ms timer will actually keep the event loop alive (which I believe actually makes sense, the test we had only worked because the timeout took more than 1ms). Ref https://github.com/denoland/deno/issues/19034
2023-05-21fix(ci): simplify test assertion for http version enforcing with ↵Leo Kettmeir
Deno.createHttpClient (#19210)
2023-05-21feat(unstable): add more options to Deno.createHttpClient (#17385)Leo Kettmeir
2023-05-19feat(ext/http): ref/unref for server (#19197)Matt Mastracci
Add `ref` and `unref` to return value from `Deno.serve`. Unblocks #3326.
2023-05-18feat(ext/http): Add support for trailers w/internal API (HTTP/2 only) (#19182)Matt Mastracci
Necessary for #3326. Requested in #10214 as well.
2023-05-19BREAKING(unstable): change return type of Deno.serve() API (#19189)Bartek Iwańczuk
This commit changes the return type of an unstable `Deno.serve()` API to instead return a `Deno.Server` object that has a `finished` field. This change is done in preparation to be able to ref/unref the HTTP server.
2023-05-18chore: lint server_test.ts (#19175)Bartek Iwańczuk
Somehow this file had `// deno-lint-ignore-file` directive at the top. This commit removes it and fixes all the linter violations.
2023-05-17fix: support "fetch" over HTTPS for IP addresses (#18499)Bartek Iwańczuk
This commit adds support for connecting to IP addresses over HTTPS. This is done by updating "rustls" to "0.21.0" and other related crates. Closes https://github.com/denoland/deno/issues/7660 Closes https://github.com/denoland/deno/issues/17967 --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-05-16fix(ext/http): Ensure cancelled requests don't crash Deno.serve (#19154)Matt Mastracci
Fixes for various `Attemped to access invalid request` bugs (#19058, #15427, #17213). We did not wait for both a drop event and a completion event before removing items from the slab table. This ensures that we do so. In addition, the slab methods are refactored out into `slab.rs` for maintainability.
2023-05-16fix(fetch): Correctly decode `multipart/form-data` names and filenames (#19145)Andreu Botella
Currently the `multipart/form-data` parser in `Request.prototype.formData` and `Response.prototype.formData` decodes non-ASCII filenames incorrectly, as if they were encoded in Latin-1 rather than UTF-8. This happens because the header section of each `multipart/form-data` entry is decoded as Latin-1 in order to be parsed with `Headers`, which only allows `ByteString`s, but the names and filenames are never decoded correctly. This PR fixes this as a post-processing step. Note that the `multipart/form-data` parsing for this APIs in the Fetch spec is very much underspecified, and it does not specify that names and filenames must be decoded as UTF-8. However, it does require that the bodies of non-`File` entries are decoded as UTF-8, and in browsers, names and filenames always use the same encoding as the body. Closes #19142.
2023-05-11fix(cli): upgrade to Typescript 5.0.4 (#19090)David Sherret
2023-05-11fix(console): handle error when inspecting promise-like (#19083)Nayeem Rahman
Fixes https://discord.com/channels/684898665143206084/684911491035430919/1105900195406958672. This was caused by: - A `TypeError` from `core.getPromiseDetails()` for promise-likes which also lead to that code path. - Swallowing internal formatting errors by returning `undefined`. I've made it so that a special message is formatted in that case instead (note that this case is fixed now): ![image](https://github.com/denoland/deno/assets/29990554/65bb9612-60b2-4e31-bf5e-e20976601593)
2023-05-11fix(runtime): `ChildProcess::kill()` doesn't require additional perms (#15339)Nayeem Rahman
Fixes #15217.
2023-05-10feat(ext/http): Automatic compression for Deno.serve (#19031)Matt Mastracci
`Content-Encoding: gzip` support for `Deno.serve`. This doesn't support Brotli (`br`) yet, however it should not be difficult to add. Heuristics for compression are modelled after those in `Deno.serveHttp`. Tests are provided to ensure that the gzip compression is correct. We chunk a number of different streams (zeros, hard-to-compress data, already-gzipped data) in a number of different ways (regular, random, large/small, small/large).
2023-05-08fix(ext/http): Ensure Deno.serve works across --watch restarts (#18998)Matt Mastracci
Fixes #16699 and #18960 by ensuring that we release our HTTP `spawn_local` tasks when the HTTP resource is dropped. Because our cancel handle was being projected from the resource via `RcMap`, the resource was never `Drop`ped. By splitting the handle out into its own `Rc`, we can avoid keeping the resource alive and let it drop to cancel everything.
2023-05-03fix(ext/kv): throw on the Kv constructor (#18978)Luca Casonato
Closes #18963 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-03fix(ext/kv): KvU64#valueOf and KvU64 inspect (#18656)Luca Casonato
`new Deno.KvU64(1n) + 2n == 3n` is now true. `new Deno.KvU64(1n)` is now inspected as `[Deno.KvU64: 1n]` (`Object(1n)` is inspected as `[BigInt: 1n]`). --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-30fix(ext/url): throw `TypeError` for empty argument (#18896)Kenta Moriuchi
Fixes #18893
2023-04-30perf(core): async op pseudo-codegen and performance work (#18887)Matt Mastracci
Performance: ``` async_ops.js: 760k -> 1030k (!) async_ops_deferred.js: 730k -> 770k Deno.serve bench: 118k -> 124k WS test w/ third_party/prebuilt/mac/load_test 100 localhost 8000 0 0: unchanged Startup time: approx 0.5ms slower (13.7 -> 14.2ms) ```
2023-04-30refactor: merge Deno & Node inspectors (#18691)Leo Kettmeir
2023-04-29fix(ext/kv): stricter structured clone serializer (#18914)Luca Casonato
2023-04-28fix(ext/fetch): subview Uint8Array in Req/Resp (#18890)Luca Casonato
2023-04-28Revert "refactor: don't expose Deno[Deno.internal].core namespace" (#18881)Bartek Iwańczuk
Also conditionally disabled one test if there's not enough space on device.
2023-04-27feat(kv): return ok bool from atomic commit (#18873)Luca Casonato
2023-04-27feat(lint): add `Deno.run` to `no-deprecated-deno-api` (#18869)Bartek Iwańczuk
This upgrade includes a warning for the deprecated "Deno.run()" API. --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2023-04-26fix(dts): `URLPatternComponentResult` groups should have possibly undefined ↵David Sherret
key values (#18643) Closes #18640
2023-04-27fix(ext/http): internal upgradeHttpRaw works with "Deno.serve()" API (#18859)Matt Mastracci
Fix internal "upgradeHttpRaw" API restoring capability to upgrade HTTP connection in polyfilles "node:http" API.
2023-04-26feat(ext/kv): add more atomic operation helpers (#18854)Ryan Dahl
Co-authored-by: losfair <zhy20000919@hotmail.com> Co-authored-by: Luca Casonato <hello@lcas.dev>