summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
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>
2024-05-22fix(lsp): process Fenced Code Block in JSDoc on `completion` correctly (#23822)Hajime-san
partially fixing https://github.com/denoland/deno/issues/23820 https://github.com/denoland/deno/assets/41257923/0adb5d4e-cfd5-4195-9045-19d1c0a07a43 BTW, it is out of scope on this PR that to process type of `@param` to be an code block due to it's a bit complicated.
2024-05-22chore: Fix failing `task_npx_non_existent` test (#23945)Nathan Whitaker
Currently `task::task_npx_non_existent` is consistently failing in CI ([example](https://github.com/denoland/deno/actions/runs/9192958846/job/25282900321#step:43:2772)) due to the output changing slightly ``` -- OUTPUT START -- Task non-existent npx this-command-should-not-exist-for-you npm ERR! code E404 npm ERR! 404 Not Found - GET http://localhost:4260/this-command-should-not-exist-for-you npm ERR! 404 npm ERR! 404 'this-command-should-not-exist-for-you@*' is not in this registry. npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. npm ERR! A complete log of this run can be found in: /Users/runner/.npm/_logs/2024-05-22T17_58_42_473Z-debug-0.log -- OUTPUT END -- -- EXPECTED START -- Task non-existent npx this-command-should-not-exist-for-you npm error code E404 npm error 404 Not Found - GET http://localhost:4260/this-command-should-not-exist-for-you [WILDCARD] -- EXPECTED END -- ``` I'm not sure what changed in CI to cause this (and I can't repro it locally, even matching the version of npm and node on the github runners), but fix it with more lenient expected output for that test.
2024-05-22chore(repl): maybe improve repl test flakiness on the CI (#23933)David Sherret
These repl tests are still a bit flaky. Let's try this. https://github.com/denoland/deno/actions/runs/9176525869/job/25232001263
2024-05-22feat(cli): Add slow test warning (#23874)Matt Mastracci
By default, uses a 60 second timeout, backing off 2x each time (can be overridden using the hidden `DENO_SLOW_TEST_TIMEOUT` which we implement only really for spec testing. ``` Deno.test(async function test() { await new Promise(r => setTimeout(r, 130_000)); }); ``` ``` $ target/debug/deno test /tmp/test_slow.ts Check file:///tmp/test_slow.ts running 1 test from ../../../../../../tmp/test_slow.ts test ...'test' is running very slowly (1m0s) 'test' is running very slowly (2m0s) ok (2m10s) ok | 1 passed | 0 failed (2m10s) ``` --------- Signed-off-by: Matt Mastracci <matthew@mastracci.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-22refactor(docs): use `@experimental` instead of `@tags unstable` (#23884)Leo Kettmeir
2024-05-21feat(node): buffer isUtf8/isAscii (#23928)snek
Fixes: https://github.com/denoland/deno/issues/23657 Implements `isUtf8` and `isAscii` as ops.
2024-05-21fix(lsp): Fix display of JSDoc named examples (#23927)Nathan Whitaker
We were wrapping the display string in an unnecessary pair of triple backticks, breaking highlighting Before: ![Screenshot 2024-05-21 at 12 16 12 PM](https://github.com/denoland/deno/assets/17734409/1cf5a3ce-56dd-443d-9d1a-bd33625ff1f2) After: ![Screenshot 2024-05-21 at 12 16 36 PM](https://github.com/denoland/deno/assets/17734409/646c4c48-9b5a-4326-bb95-b1374627d969)
2024-05-21refactor(jupyter): use runtimelib for Jupyter structures and directory paths ↵Kyle Kelley
(#23826) This brings in [`runtimelib`](https://github.com/runtimed/runtimed) to use: ## Fully typed structs for Jupyter Messages ```rust let msg = connection.read().await?; self .send_iopub( runtimelib::Status::busy().as_child_of(msg), ) .await?; ``` ## Jupyter paths Jupyter paths are implemented in Rust, allowing the Deno kernel to be installed completely via Deno without a requirement on Python or Jupyter. Deno users will be able to install and use the kernel with just VS Code or other editors that support Jupyter. ```rust pub fn status() -> Result<(), AnyError> { let user_data_dir = user_data_dir()?; let kernel_spec_dir_path = user_data_dir.join("kernels").join("deno"); let kernel_spec_path = kernel_spec_dir_path.join("kernel.json"); if kernel_spec_path.exists() { log::info!("✅ Deno kernel already installed"); Ok(()) } else { log::warn!("ℹ️ Deno kernel is not yet installed, run `deno jupyter --install` to set it up"); Ok(()) } } ``` Closes https://github.com/denoland/deno/issues/21619
2024-05-21fix(lsp): apply import fix to missing declaration code action (#23924)Nayeem Rahman
2024-05-21chore: add test to ensure parsing only happens once on first load (#23837)David Sherret