summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2024-07-10fix(node/perf_hooks): stub eventLoopUtilization (#24501)Marvin Hagemeister
This PR stubs `perf_hooks.eventLoopUtilization` to make the tests of [hapi](https://github.com/hapijs/hapi) start. Previously, they'd all error because of this function throwing a not implemented error. This brings down the test failures in their suite from 982 to 68 failures.
2024-07-10fix(node/http): don't send destroyed requests (#24498)Marvin Hagemeister
Make sure that already destroyed requests are not actually sent. This error was discovered in jsdom's test suite.
2024-07-10fix(node/http): don't error if request destroyed before send (#24497)Marvin Hagemeister
A request can be destroyed before it was even made in the Node http API. We errored on that. This issue was discovered in the JSDOM test suite.
2024-07-10fix(net): set correct max size for Datagram (#21611)Andrew Johnston
2024-07-10feat(node): Support executing npm package lifecycle scripts ↵Nathan Whitaker
(preinstall/install/postinstall) (#24487) Adds support for running npm package lifecycle scripts, opted into via a new `--allow-scripts` flag. With this PR, when running `deno cache` (or `DENO_FUTURE=1 deno install`) you can specify the `--allow-scripts=pkg1,pkg2` flag to run lifecycle scripts attached to the given packages. Note at the moment this only works when `nodeModulesDir` is true (using the local resolver). When a package with un-run lifecycle scripts is encountered, we emit a warning suggesting things may not work and to try running lifecycle scripts. Additionally, if a package script implicitly requires `node-gyp` and it's not found on the system, we emit a warning. Extra things in this PR: - Extracted out bits of `task.rs` into a separate module for reuse - Added a couple fields to `process.config` in order to support `node-gyp` (it relies on a few variables being there) - Drive by fix to downloading new npm packages to test registry --- TODO: - [x] validation for allow-scripts args (make sure it looks like an npm package) - [x] make allow-scripts matching smarter - [ ] figure out what issues this closes --- Review notes: - This adds a bunch of deps to our test registry due to using `node-gyp`, so it's pretty noisy
2024-07-10feat: deprecate `deno vendor` (#22183)Asher Gomez
This commit deprecates `deno vendor` subcommand in favor of using `--vendor` flag or `"vendor": true` setting in the config file. The subcommand is still available (until Deno 2) but is hidden from the help output. Closes #20584 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-09feat(cli): `deno init --lib` (#22499)muddlebee
Closes #22287 Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com> Co-authored-by: David Sherret <dsherret@gmail.com>
2024-07-09fix: panic when piping "deno help" or "deno --version" (#22917)muddlebee
Fixes #22863 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-09feat(compile): support --env (#24166)HasanAlrimawi
Supported the use of --env flag with the compile subcommand, so that the generated executable/binary file can access the passed env file.
2024-07-09fix: do not download compilerOptions -> types when not type checking (#24473)David Sherret
Closes https://github.com/denoland/deno/issues/22738
2024-07-09fix: restore reference to dom.extras in lib.dom.d.ts (#24489)Bartek Iwańczuk
This was changed by mistake in #24326. Closes https://github.com/denoland/deno/issues/24459.
2024-07-09fix: test in presence of .npmrc (#24486)snek
override home dir so .npmrc on the dev machine doesn't break it Signed-off-by: snek <snek@deno.com>
2024-07-09fix: do not return undefined for missing global properties (#24474)snek
accessing e.g. `Buffer` in `Mode::Deno` mode should throw, not return undefined. --------- Signed-off-by: snek <snek@deno.com>
2024-07-09refactor: use concrete error types for node resolution (#24470)David Sherret
This will help clean up some of the code in the CLI because we'll be able to tell how the resolution failed (not part of this PR).
2024-07-09fix(node/http): support all `.writeHead()` signatures (#24469)Marvin Hagemeister
Implement the missing `.writeHead()` signatures from Node's `ServerResponse` class that we didn't support. Fixes https://github.com/denoland/deno/issues/24468
2024-07-09fix(lsp): do sloppy resolution for node-to-node imports in byonm (#24481)Nayeem Rahman
2024-07-09fix(net): handle panic on Windows for Unix socket usage in Deno.serve() ↵Yazan AbdAl-Rahman
(#24423) This PR addresses the issue where Deno.serve() panics on Windows when trying to use a Unix socket. Fixes #21967
2024-07-09fix: add warning for invalid unstable feature use in deno.json/jsonc (#24120)HasanAlrimawi
2024-07-09feat: support wildcards in npm workspaces (#24471)David Sherret
Implemented in https://github.com/denoland/deno_config/pull/74 Closes https://github.com/denoland/deno/issues/24420
2024-07-08fix(lsp): inherit workspace-root-only fields in members (#24440)Nayeem Rahman
2024-07-08fix(node/assert): throws not checking error instance (#24466)Marvin Hagemeister
The implementation for `assert.throws()` from `node:assert` didn't work when the expected value was an `Error` constructor. In this case the thrown error should checked if it's an instance of said constructor. Fixes https://github.com/denoland/deno/issues/24464
2024-07-05fix(permissions): handle ipv6 addresses correctly (#24397)Luca Casonato
Also don't panic on invalid domain names and addresses. Extracted with cleanups up from #24080 Co-authored-by: Yazan AbdAl-Rahman <yazan.abdalrahman@exalt.ps>
2024-07-05refactor: move `FileCollector` to deno_config (#24433)David Sherret
2024-07-05fix(node): Implement `fs.lchown` (and `process.getegid`) (#24418)Nathan Whitaker
Closes https://github.com/denoland/deno/issues/21260. Part of https://github.com/denoland/deno/issues/18218. Implements `node:fs.lchown`, and enables the node_compat test for it. The test uses `process.getegid`, which we didn't have implemented, so I went ahead and implemented that as well to get the test working.
2024-07-05fix(ext/node): rewrite digest handling (#24392)Luca Casonato
Previously we had many different code paths all handling digests in different places, all with wildly different digest support. This commit rewrites this to use a single digest handling mechanism for all digest operations. It adds various aliases for digest algorithms, like node does. For example `sha1WithRSAEncryption` is an alias for `sha1`. It also adds support for `md5-sha1` digests in various places.
2024-07-05fix(ext/node): http chunked writes hangs (#24428)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/24239
2024-07-05feat: Deprecate --lock-write flag (#24436)Bartek Iwańczuk
This commit deprecates `--lock-write` flag by removing it from the help output and printing a warning message when it's used. Users should use `--frozen=false` instead which was added in https://github.com/denoland/deno/pull/24355. Towards https://github.com/denoland/deno/issues/24167.
2024-07-05fix(publish): unfurling should always be done with the package json (#24435)David Sherret
Closes https://github.com/denoland/deno/issues/24430
2024-07-04fix(node/http): don't throw on .address() before .listen() (#24432)Marvin Hagemeister
It's perfectly valid to access `server.address()` before calling `.listen()`. Until a server actively listens on a socket Node will return `null` here, but we threw a "Cannot access property 'port' of undefined" instead. This was discovered when inspecting failures in Koa's test suite with Deno.
2024-07-04feat(ext/crypto): make deriveBits length parameter optional and nullable ↵Filip Skokan
(#24426) Updates SubtleCrypto.prototype.deriveBits as per https://github.com/w3c/webcrypto/pull/345 (WPT update in https://github.com/web-platform-tests/wpt/pull/43400)
2024-07-04feat: npm workspace and better Deno workspace support (#24334)David Sherret
Adds much better support for the unstable Deno workspaces as well as support for npm workspaces. npm workspaces is still lacking in that we only install packages into the root node_modules folder. We'll make it smarter over time in order for it to figure out when to add node_modules folders within packages. This includes a breaking change in config file resolution where we stop searching for config files on the first found package.json unless it's in a workspace. For the previous behaviour, the root deno.json needs to be updated to be a workspace by adding `"workspace": ["./path-to-pkg-json-folder-goes-here"]`. See details in https://github.com/denoland/deno_config/pull/66 Closes #24340 Closes #24159 Closes #24161 Closes #22020 Closes #18546 Closes #16106 Closes #24160
2024-07-03fix(lsp): correct scope attribution for injected @types/node (#24404)Nayeem Rahman
2024-07-03feat: Upgrade to TypeScript 5.5.2 (#24326)Bartek Iwańczuk
This commit upgrades TypeScript to 5.5.2. https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/
2024-07-03fix(ext/node): don't wait for end() call to send http client request (#24390)Satya Rohith
Closes https://github.com/denoland/deno/issues/24232 Closes https://github.com/denoland/deno/issues/24215
2024-07-02fix(ext/node): Add `fs.lutimes` / `fs.lutimesSync` (#23172)Nathan Whitaker
Part of #18218 - Adds `fs.lutimes` and `fs.lutimesSync` to our node polyfills. To do this I added methods to the `FileSystem` trait + ops to expose the functionality to JS. - Exports `fs._toUnixTimestamp`. Node exposes an internal util `toUnixTimestamp` from the fs module to be used by unit tests (so we need it for the unit test to pass unmodified). It's weird because it's only supposed to be used internally but it's still publicly accessible - Matches up error handling and timestamp handling for fs.futimes and fs.utimes with node - Enables the node_compat utimes test - this exercises futimes, lutimes, and utimes.
2024-07-02fix(compile): prevent setting unstable feature twice (#24381)HasanAlrimawi
Prevent panic when enabling a feature that is already enabled by removing duplicate features. Closes #22015 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-02feat(cli): Add `--frozen` flag to error out if lockfile is out of date (#24355)Nathan Whitaker
Closes #18296. Adds a `--frozen` (alias `--frozen-lockfile`) flag that errors out if the lockfile is out of date. This is useful for running in CI (where an out of date lockfile is usually a mistake) or to prevent accidental changes in dependencies. ![Screenshot 2024-06-26 at 7 11 13 PM](https://github.com/denoland/deno/assets/17734409/538404b8-b422-4f05-89e8-4c9b1c248576)
2024-07-02feat(ext/web): add `Blob.prototype.bytes()` (#24148)Kenta Moriuchi
2024-07-02chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24388)Bartek Iwańczuk
Reland of https://github.com/denoland/deno/pull/24056 that doesn't suffer from the problem that was discovered in https://github.com/denoland/deno/pull/24261. It uses upgraded `hyper` and `hyper-util` that fixed the previous problem in https://github.com/hyperium/hyper/pull/3691.
2024-07-01fix(windows): check USERPROFILE env var for finding home directory (#24384)David Sherret
2024-07-01fix(lsp): respect lockfile redirects entries for resolution (#24365)Nayeem Rahman
2024-07-01BREAKING(unstable/ffi): remove callback reentrant flag (#24367)Divy Srivastava
Closes https://github.com/denoland/deno/issues/22947 This option is no longer needed as fast calls are now allowed to re-enter the isolate
2024-06-28chore: update deno_doc (#24308)Leo Kettmeir
2024-06-26feat(lsp): ts language service scopes (#24345)Nayeem Rahman
2024-06-27fix(ext/node): discover .npmrc in user's homedir (#24021)Bartek Iwańczuk
This commit adds discovery of `.npmrc` files in user's homedir. This is not a perfect fix as it doesn't merge multiple `.npmrc` files together as per https://github.com/denoland/deno/issues/23954 but allows to fallback if no `.npmrc` file is discovered in the project root.
2024-06-26refactor: move PackageJson to deno_config (#24348)David Sherret
2024-06-26perf(ext/node): improve `Buffer.from(buffer)` (#24352)ud2
Benchmark code from #24341. ```shellsession $ deno run --allow-hrtime bench.mjs 6479.111583 $ target/release/deno run --allow-hrtime bench.mjs 962.753875 $ node bench.mjs 855.174875 ```
2024-06-25fix(ext/websocket): drop connection when close frame not ack (#24301)Divy Srivastava
Fixes #24292
2024-06-25fix(ext/node): ignore stream error during enqueue (#24243)Satya Rohith
2024-06-25test(node_compat): enable more stream-writable tests (#24328)Satya Rohith