summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
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
2024-05-21fix(task): do not error if node_modules folder not exists (#23920)David Sherret
Revealed https://github.com/denoland/deno/issues/23919 Closes #23914
2024-05-21fix(cli): use CliNodeResolver::resolve() for managed node_modules (#23902)Nayeem Rahman
2024-05-21perf: analyze cjs re-exports in parallel (#23894)David Sherret
2024-05-21fix(cli/coverage): invalid line id in html reporter (#23908)Simon Lecoq
2024-05-20fix(ext/webgpu): Allow `depthClearValue` to be undefined when `depthLoadOp` ↵chirsz
is not "clear" (#23850)
2024-05-20fix(node): stub findSourceMap for `ava` (#23899)Marvin Hagemeister
This stubs `findSourceMap` in `node:module` by always returning `undefined` as if it never found a source map. This unblocks the `ava` test runner. Fixes https://github.com/denoland/deno/issues/18666
2024-05-20fix(node): track `SIG*` listeners in `process.listeners` (#23890)Marvin Hagemeister
Some npm libraries like `signal-exit` rely on the length of the listener array returned by `process.listeners("SIGNT")` to be correct to function. We weren't tracking `SIG*` events there, which broke those npm libraries. Fixes https://github.com/denoland/deno/issues/22892
2024-05-20fix(node): patch MessagePort in worker_thread message (#23871)Marvin Hagemeister
Our `MessagePort` to Node's `MessagePort` conversion logic was missing the case where a `MessagePort` is sent _inside_ the message. This broke `tinypool` which is used by `vitest` as it relies on some node specific methods on `MessagePort`. Fixes https://github.com/denoland/deno/issues/23854 , Fixes https://github.com/denoland/deno/pull/23871
2024-05-19fix: handle signal 0 in process.kill (#23473)Bedis Nbiba
the last commit had a regression, where it removed this branch, I haven't tested the code but I think it should work --------- Signed-off-by: Bedis Nbiba <bedisnbiba@gmail.com>
2024-05-18perf: analyze cjs exports and emit typescript in parallel (#23856)David Sherret
2024-05-17fix(node): instantiating process class without new (#23865)Marvin Hagemeister
Popular test runners like Jest instantiate a new `Process` object themselves and expect the class constructor to be callable without the `new` keyword. This PR refactors our `Process` class implementation from a proper ES2015 class to an ES5-style class which can be invoked both with and without the `new` keyword like in Node. Fixes https://github.com/denoland/deno/issues/23863
2024-05-17fix: serve handler error with 0 arguments (#23652)Marvin Hagemeister
Fixes https://github.com/denoland/deno/issues/23651 Co-authored-by: Satya Rohith <me@satyarohith.com>
2024-05-17feat(serve): support `--port 0` to use an open port (#23846)Satya Rohith
Closes https://github.com/denoland/deno/issues/23845
2024-05-16fix(lsp): respect types dependencies for tsc roots (#23825)Nayeem Rahman
2024-05-16fix(node): seperate worker module cache (#23634)Divy Srivastava
Construct a new module graph container for workers instead of sharing it with the main worker. Fixes #17248 Fixes #23461 --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2024-05-16fix(ext/node): homedir() `getpwuid`/`SHGetKnownFolderPath` fallback (#23841)Divy Srivastava
**Unix**: Returns the value of the HOME environment variable if it is set even if it is an empty string. Otherwise, it tries to determine the home directory by invoking the [getpwuid_r](https://linux.die.net/man/3/getpwuid_r) function with the UID of the current user. **Windows**: Returns the value of the USERPROFILE environment variable if it is set and it is not an empty string. Otherwise, it tries to determine the home directory by invoking the [SHGetKnownFolderPath](https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath) function with [FOLDERID_Profile](https://learn.microsoft.com/en-us/windows/win32/shell/knownfolderid). Fixes https://github.com/denoland/deno/issues/23824
2024-05-16fix(ext/node): export geteuid from node:process (#23840)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/23827
2024-05-16perf(jsr): download metadata files as soon as possible and in parallel (#23836)David Sherret
* https://github.com/denoland/deno_graph/pull/471 * https://github.com/denoland/deno_graph/pull/473
2024-05-15chore: Fix flaky semantic tokens caching test (#23831)Nathan Whitaker
The stderr stream from the LSP is consumed by a separate thread, so it may not have processed the part we care about yet. Instead, wait until you see the measure for the request you care about.
2024-05-15fix(node): wrong `worker_threads.terminate()` return value (#23803)Marvin Hagemeister
<!-- Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> Fixes https://github.com/denoland/deno/issues/23801 --------- Signed-off-by: Marvin Hagemeister <marvinhagemeister50@gmail.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-15chore: fix flaky '[node/http] send request with non-chunked body' test (#23818)David Sherret
https://github.com/denoland/deno/actions/runs/9086887959/job/24973565321
2024-05-15perf(lsp): Cache semantic tokens for open documents (#23799)Nathan Whitaker
VScode will typically send a `textDocument/semanticTokens/full` request followed by `textDocument/semanticTokens/range`, and occassionally request semantic tokens even when we know nothing has changed. Semantic tokens also get refreshed on each change. Computing semantic tokens is relatively heavy in TSC, so we should avoid it as much as possible. Caches the semantic tokens for open documents, to avoid making TSC do unnecessary work. Results in a noticeable improvement in local benchmarking before: ``` Starting Deno benchmark -> Start benchmarking lsp - Simple Startup/Shutdown (10 runs, mean: 383ms) - Big Document/Several Edits (5 runs, mean: 1079ms) - Find/Replace (10 runs, mean: 59ms) - Code Lens (10 runs, mean: 440ms) - deco-cx/apps Multiple Edits + Navigation (5 runs, mean: 9921ms) <- End benchmarking lsp ``` after: ``` Starting Deno benchmark -> Start benchmarking lsp - Simple Startup/Shutdown (10 runs, mean: 395ms) - Big Document/Several Edits (5 runs, mean: 1024ms) - Find/Replace (10 runs, mean: 56ms) - Code Lens (10 runs, mean: 438ms) - deco-cx/apps Multiple Edits + Navigation (5 runs, mean: 8927ms) <- End benchmarking lsp ```
2024-05-14chore: fix flaky rejection_handled_web_process (#23817)David Sherret
Closes https://github.com/denoland/deno/issues/23712
2024-05-15fix(node): stub `AsyncResource.emitDestroy()` (#23802)Marvin Hagemeister
<!-- Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> Fixes https://github.com/denoland/deno/issues/23397
2024-05-14fix(emit): regression - keep comments in emit (#23815)David Sherret
Closes https://github.com/denoland/deno/discussions/23814
2024-05-14fix(lsp): show reference code lens on methods (#23804)Nayeem Rahman
2024-05-14chore(tests): increase repl timeout on ci (#23812)David Sherret
https://github.com/denoland/deno/actions/runs/9084225162/job/24964698935 ``` ---- run::file_fetcher_preserves_permissions stdout ---- command /Users/runner/work/deno/deno/target/debug/deno repl --quiet command cwd /Users/runner/work/deno/deno/tests/testdata ------ Start Full Text ------ "const a = await import('http://localhost:4545/run/019_media_types.ts');\r\n" ------- End Full Text ------- Next text: "\r\n" thread 'run::file_fetcher_preserves_permissions' panicked at tests/integration/run_tests.rs:4615:15: Timed out. ``` Closes https://github.com/denoland/deno/issues/23690 Closes https://github.com/denoland/deno/issues/23682 Closes https://github.com/denoland/deno/issues/23625
2024-05-14fix(publish): always include config file when publishing (#23797)David Sherret
Closes https://github.com/denoland/deno/issues/23796
2024-05-14chore: 045_proxy output stdout & stderr on failure (#23810)David Sherret
Part of https://github.com/denoland/deno/issues/23624
2024-05-14fix(publish): error for missing version constraints on dry-publish instead ↵David Sherret
of just publish (#23798) Closes https://github.com/denoland/deno/issues/22835
2024-05-14fix: Add missing `"junction"` type for `SymlinkOptions.types` (#23756)futsuuu
Junction symlink support is added in #22762, but `SymlinkOptions` and its documents are not updated.
2024-05-13fix(ext/web): update ongoing promise in async iterator `return()` method ↵Mattias Buelens
(#23642) See https://github.com/whatwg/webidl/pull/1387 for context. There are new WPT tests for this change in https://github.com/web-platform-tests/wpt/pull/44456. They pass on my local machine, but I'm not sure if I should update the WPT submodule for all of Deno as part of this PR? Fixes #22389 --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.
2024-05-13chore(task): various small refactorings (#23793)David Sherret
2024-05-13chore: cleanup unused dependencies (#23787)Leo Kettmeir
2024-05-13fix(cli): panic with `deno coverage` (#23353)Evan
This PR directly addresses the issue raised in #23282 where Deno panics if `deno coverage` is called with `--include` regex that returns no matches. I've opted not to change the return value of `collect_summary` for simplicity and return an empty `HashMap` instead
2024-05-12fix(ext/node): process.uptime works without this (#23786)Bartek Iwańczuk
Fixes https://github.com/denoland/deno/issues/23761 Co-authored-by: Satya Rohith <me@satyarohith.com>
2024-05-12fix(npm): handle null fields in npm registry JSON (#23785)David Sherret
* https://github.com/denoland/deno_npm/pull/52 Closes https://github.com/denoland/deno/issues/23776
2024-05-10fix(runtime): Allow opening /dev/fd/XXX for unix (#23743)Matt Mastracci
`deno run script.ts <(some command)` is a valid use case -- let's allow this to work without `--allow-all`. Fixes #23703
2024-05-10fix(node): better cjs re-export handling (#23760)David Sherret
Closes #23458
2024-05-10fix(ext/webgpu): invalidate GPUAdapter when a device is created (#23752)Leo Kettmeir
This removes the need for using `Deno.resources` to close the gpuadapter resource, while being more spec compliant.