summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2024-06-02fix: validate integer values in `Deno.exitCode` setter (#24068)Kenta Moriuchi
2024-06-02chore: disable part of `test-fs-read-stream.js` (#24085)Bartek Iwańczuk
2024-06-02chore: update wpt suite (#24070)Kenta Moriuchi
2024-05-30feat: do not require `DENO_FUTURE=1` for npmrc support (#24043)David Sherret
2024-05-30feat(lsp): support .npmrc (#24042)Nayeem Rahman
Closes #24040
2024-05-30BREAKING(ffi/unstable): use BigInt representation in turbocall (#23983)Aapo Alasuutari
Built ontop of #23981, this sets FFI turbocalls (Fast Call API) to use the BigInt representation.
2024-05-29fix(cli): Prefer npm bin entries provided by packages closer to the root ↵Nathan Whitaker
(#24024) Fixes #24012. In the case of multiple packages providing a binary with a same name, we were basically leaving the results undefined (since we set up things in parallel, and whichever got set up first won). In addition, we were warning about these cases, even though it's a situation that's expected to occur. Instead, in the case of a collision in the binary names, we prefer the binary provided by the package with the least depth in the dependency tree. While I was at it, I also took moved more code to `bin_entries.rs` since it was starting to get a bit cluttered.
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-05-29perf(repl): don't walk workspace in repl language server (#24037)Nayeem Rahman
2024-05-29fix(task): always use `npm` for `npm run` with flags (#24028)Marvin Hagemeister
2024-05-29perf: avoid building module graph if dynamic specifier already in graph (#24035)David Sherret
2024-05-29fix: bump cache sqlite dbs to v2 for WAL journal mode change (#24030)David Sherret
In https://github.com/denoland/deno/pull/23955 we changed the sqlite db journal mode to WAL. This causes issues when someone is running an old version of Deno using TRUNCATE and a new version because the two fight against each other.
2024-05-29fix(ext/node): windows cancel stdin read in line mode (#23969)Divy Srivastava
This patch fixes stdin read hanging on user input when switching tty mode on Windows Fixes #21111 On Windows, when switching from line to raw mode: - Cancel ongoing console read by writing a return keypress to its input buffer. This blocks the main thread until any ongoing read has been cancelled to prevent interference with the screen state. - On the read thread, restore the cursor position to where it was before writing the enter, undoing its effect on the screen state. - Restart reading and notify the main thread.
2024-05-29fix(ext/node): don't encode buffer data as utf8 in http2 (#24016)Satya Rohith
2024-05-29perf(lsp): lock out requests until init is complete (#23998)Nayeem Rahman
2024-05-28fix(ext/http): flush gzip streaming response (#23991)Bartek Iwańczuk
This commit changes `gzip` compression in `Deno.serve` API to flush data after each write. There's a slight performance regression, but provided test shows a scenario that was not possible before. --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-05-28perf: skip npm install if graph has no new packages (#24017)David Sherret
2024-05-28feat(vendor): support modifying remote files in vendor folder without ↵David Sherret
checksum errors (#23979) Includes: * https://github.com/denoland/deno_graph/pull/486 * https://github.com/denoland/deno_graph/pull/488 * https://github.com/denoland/deno_lockfile/pull/25 * https://github.com/denoland/deno_lockfile/pull/22 * https://github.com/denoland/deno_graph/pull/483 * https://github.com/denoland/deno_graph/pull/470
2024-05-28chore: fix flaky inspector_with_ts_files (#24015)David Sherret
2024-05-28fix(coverage): do not generate script coverage with empty url (#24007)Yoshiya Hinosawa
closes #24004
2024-05-28fix(cli/test): decoding percent-encoding(non-ASCII) file path correctly (#23200)Hajime-san
# Summary This PR resolves about the issue. fixes #10810 And the formerly context is in the PR. #22582 Here is an expected behaviour example with this change. - 🦕.test.ts ```ts import { assertEquals } from "https://deno.land/std@0.215.0/assert/mod.ts"; Deno.test("example test", () => { assertEquals("🍋", "🦕"); }); ```
2024-05-28fix(ext/node/fs): `position` argument not applied (#24009)Marvin Hagemeister
We didn't honour the `position` options of `fd.read` and `fd.write` because we checked if the buffer is of type `Buffer` instead of just `Uint8Array`. Node does the latter. In doing so I noticed that the file handle id was written to a public property which it definitely shouldn't be. This was probably a typo. Fixes https://github.com/denoland/deno/issues/23707
2024-05-28FUTURE(ext/ffi,ext/webgpu): stabilize FFI and WebGPU APIs (#24011)Asher Gomez
Closes #23906
2024-05-28fix(coverage): skip generating coverage json for http(s) scripts (#24008)Yoshiya Hinosawa
closes #21784
2024-05-28fix(ext/node): add `throwIfNoEntry` option in `fs.lstatSync` (#24006)Marvin Hagemeister
We didn't support the `throwIfNoEntry` option for Node's `fs.lstatSync` method. Note that the async variant doesn't have this option. Fixes https://github.com/denoland/deno/issues/23996
2024-05-28BREAKING(ffi/unstable): always return u64 as bigint (#23981)Divy Srivastava
The mixed `number | bigint` representation was useful optimization for pointers. Now, pointers are represented as V8 externals. As part of the FFI stabilization effort we want to make `bigint` the only representation for `u64` and `i64`. BigInt representation performance is almost on par with mixed representation with the added benefit that its less confusing and users don't need manual checks and conversions for doing operations on the value. ``` cpu: AMD Ryzen 5 7530U with Radeon Graphics runtime: deno 1.43.6+92a8d09 (x86_64-unknown-linux-gnu) file:///home/divy/gh/ffi/main.ts benchmark time (avg) iter/s (min … max) p75 p99 p995 -------------------------------------------------------------------------- ----------------------------- nop 4.01 ns/iter 249,533,690.5 (3.97 ns … 10.8 ns) 3.97 ns 4.36 ns 9.03 ns ret bigint 7.74 ns/iter 129,127,186.8 (7.72 ns … 10.46 ns) 7.72 ns 8.11 ns 8.82 ns ret i32 7.81 ns/iter 128,087,100.5 (7.77 ns … 12.72 ns) 7.78 ns 8.57 ns 9.75 ns ret bigint (add op) 15.02 ns/iter 66,588,253.2 (14.64 ns … 24.99 ns) 14.76 ns 19.13 ns 19.44 ns ret i32 (add op) 12.02 ns/iter 83,209,131.8 (11.95 ns … 18.18 ns) 11.98 ns 13.11 ns 14.5 ns ```
2024-05-28fix(coverage): handle ignore patterns (#23974)Yoshiya Hinosawa
closes #23972
2024-05-28fix(publish): raise diagnostics for triple-slash directives for `--dry-run` ↵David Sherret
instead of just `publish` (#23811)
2024-05-28chore: update WPT (#23997)Asher Gomez
Fixes [current failure](https://github.com/denoland/deno/actions/runs/9247491137/job/25436409566)
2024-05-27FUTURE(ext/fs): stabilize file system APIs (#23968)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/23906 --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-05-28fix(ext/fs): truncate files when a ReadableStream is passed to writeFile ↵charlotte ✨
(#23330) Closes #19697. This fixes a bug where the writeFile API can create partially-overwritten files which may lead to invalid / corrupt files or data leakage. It also aligns the behavior of writing a ReadableStream and writing a Uint8Array to the disk.
2024-05-27fix(ext/web): `ReadableStream.from()` allows `Iterable` instead of ↵Milly
`IterableIterator` (#23903) `createAsyncFromSyncIterator(x)` which is used in `ReadableStream.from()` expects `x` as `Iterable` but, previous implements specify `Iterator` or `IterableIterator`. If it was `IterableIterator`, it would work, but if it was `Iterator`, an exception will occur. Tests have been merged into WPT. https://github.com/web-platform-tests/wpt/pull/46365 --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-05-27fix: `--env` flag confusing message on syntax error (#23915)Hasan-Alrimawi
Enhanced warning message for --env flag with run and eval subcommands. The commit is specifically made to address issue #23674 by improving the warning messages that appear when using the --env flag with run or eval subcommands in the following scenarios: 1. Missing environment file. 2. Incorrect syntax in the environment file content. **Changes made** - Distinguishes between cases of missing environment file and wrong syntax in the environment file content. - Shows a concise warning message to convey the case/issue occurred. **Code changes & enhancements** - Implemented a match statement to handle different types of errors received while getting and parsing the file content to display a concise warning message, rather than simple error check and then displaying the same warning message for whatever the type of error is. - Updated the related existing tests to reflect the new warning messages. - Added two test cases to cover the wrong environment file content syntax with both run and eval subcommands. **Impact** The use of --env flag with both run/eval would be more user-friendly as it gives a precise description of what is not right when using incorrectly. If you could give it a look, @dsherret , I appreciate your feedback on these changes. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-26fix(node): set default http server response code 200 (#23977)Marvin Hagemeister
Node sets the default HTTP response status code to 200 on the `ServerResponse`. We initialised it as `undefined` before which caused a problem with 11ty's dev server. Thanks to @vrugtehagel for reporting this issue and finding the correct fix as well 🎉 Fixes https://github.com/denoland/deno/issues/23970
2024-05-26fix(coverage): add tooltip to line count in html report (#23971)Yoshiya Hinosawa
closes #21582
2024-05-23fix(npm): set up node_modules/.bin/ entries for package that provide bin ↵Bartek Iwańczuk
entrypoints (#23496) Closes https://github.com/denoland/deno/issues/23036 --------- Co-authored-by: Nathan Whitaker <nathan@deno.com>
2024-05-23FUTURE: initial support for .npmrc file (#23560)Bartek Iwańczuk
This commit adds initial support for ".npmrc" files. Currently we only discover ".npmrc" files next to "package.json" files and discovering these files in user home dir is left for a follow up. This pass supports "_authToken" and "_auth" configuration for providing authentication. LSP support has been left for a follow up PR. Towards https://github.com/denoland/deno/issues/16105
2024-05-23fix(cli): Support deno.lock with only package.json present + fix DENO_FUTURE ↵Nathan Whitaker
install interactions with lockfile (#23918) Fixes #23571. Previously, we required a `deno.json` to be present (or the `--lock` flag) in order for us to resolve a `deno.lock` file. This meant that if you were using deno in an npm-first project deno wouldn't use a lockfile. Additionally, while I was fixing that, I discovered there were a couple bugs keeping the future `install` command from using a lockfile. With this PR, `install` will actually resolve the lockfile (or create one if not present), and update it if it's not up-to-date. This also speeds up `deno install`, as we can use the lockfile to skip work during npm resolution.
2024-05-23refactor(lsp): determine file referrer for each document (#23867)Nayeem Rahman
2024-05-23feat(task): run `npm run` commands with Deno more often (#23794)David Sherret
Closes #23036
2024-05-23chore: update denokv_* crates (#23949)Bartek Iwańczuk
Co-authored-by: losfair <zhy20000919@hotmail.com>
2024-05-23fix(ext/node): add stubs for perf_hooks.PerformaceObserver (#23958)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/23943
2024-05-23refactor: remove custom `utc_now` in favor of `chrono::Utc:now` feature ↵Felipe Baltor
(#23888) This PR removes the use of the custom `utc_now` function in favor of the `chrono` implementation. It resolves #22864. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-23fix(ext/web): `ReadableStream.from()` ignores null `Symbol.asyncIterator` ↵Milly
(#23910) If `@@asyncIterator` is `null` or `undefined`, it should ignores and fallback to `@@iterator`. Tests have been merged into WPT. https://github.com/web-platform-tests/wpt/pull/46374 The proposal of `ReadableStream.from` uses TC39 [GetIterator][] and [GetMethod][] within it. GetMethod treats null as undefined. So if `@@asyncIterator` is `null` it should be ignored and fallback to `@@iterator`. [GetIterator]: https://tc39.es/ecma262/#sec-getiterator [GetMethod]: https://tc39.es/ecma262/#sec-getmethod ```bash > deno eval "ReadableStream.from({ [Symbol.asyncIterator]: null, [Symbol.iterator]: () => ({ next: () => ({ done: true }) }) }).pipeTo(new WritableStream())" error: Uncaught (in promise) TypeError: obj[SymbolAsyncIterator] is not a function ReadableStream.from({ [Symbol.asyncIterator]: null, [Symbol.iterator]: () => ({ next: () => ({ done: true }) }) }).pipeTo(new WritableStream()) ^ at getIterator (ext:deno_web/06_streams.js:5105:38) at Function.from (ext:deno_web/06_streams.js:5207:22) at file:///D:/work/js/deno/tests/wpt/suite/$deno$eval:1:16 ``` --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-05-23feat: enable pointer compression via deno_core bump (#23838)Matt Mastracci
v8 12.6 w/pointer compression enabled. Closes https://github.com/denoland/deno/issues/18935
2024-05-23feat(cli/test): `deno test --clean` (#23519)Asher Gomez
The result of the call is ignored as it throws even when the directory does not exist. Closes #23491
2024-05-22chore: kill node.js tests if they run too long (#23956)Matt Mastracci
2024-05-23feat(ext/fetch): `Request.bytes()` and `Response.bytes()` (#23823)Asher Gomez
Closes #23790
2024-05-23feat: add lowercase `-v` version flag (#23750)David Sherret
Ref https://github.com/denoland/deno/issues/5289
2024-05-23fix(runtime): use more null proto objects (#23921)Luca Casonato
This is a primordialization effort to improve resistance against users tampering with the global `Object` prototype. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>