summaryrefslogtreecommitdiff
path: root/cli/tests
AgeCommit message (Collapse)Author
2023-11-15fix(runtime): fix Deno.noColor when stdout is not tty (#21208)Yoshiya Hinosawa
2023-11-14chore: switch compile tests over to the TestBuilder (#21180)David Sherret
2023-11-14fix(ext/node): add APIs perf_hook.performance (#21192)Bartek Iwańczuk
Required for Next.js.
2023-11-14fix(ext/web): webstorage has trap for symbol (#21090)Kenta Moriuchi
2023-11-13chore(cli): unflake signal test (#21185)Matt Mastracci
If these tests do eventually break, they'll time out.
2023-11-13chore(ext/web): use a non-resource stream for ↵Matt Mastracci
textDecoderStreamCleansUpOnCancel (#21181) Follow-up fix to #21074
2023-11-13fix(install): should work with non-existent relative root (#21161)David Sherret
Closes #21160
2023-11-12fix(lsp): update tsconfig after refreshing settings on init (#21170)Nayeem Rahman
2023-11-12fix(ext/web): Prevent TextDecoderStream resource leak on stream cancellation ↵Florian Schwalm
(#21074) This PR uses the new `cancel` method of `TransformStream` to properly clean up the internal `TextDecoder` used in `TextDecoderStream` if the stream is cancelled. Fixes #13142 Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-11-11fix(ext/node): Re-enable alloc max size test (#21059)Kenta Moriuchi
Ref #21036
2023-11-11fix(node/http): export globalAgent (#21081)Jacob Hummer
Fixes #21080 Fixes #18312 --------- Signed-off-by: Jacob Hummer <jcbhmr@outlook.com>
2023-11-10chore(cli): Migrate some unit tests to "Promise.withResolvers()" (#21128)Tareque Md Hanif
Migrate to use `Promise.withResolvers()` instead of `deferred` in some of the tests in `cli/tests/unit/`. Issue: #21041
2023-11-10fix(ext/node): implement process.geteuid (#21151)Divy Srivastava
Fixes #21097
2023-11-10fix: improve `deno doc --lint` error messages (#21156)David Sherret
This also updates deno_graph, which has the JSR change to use "exports". It's not yet useful atm, so I've made this PR a fix about the deno doc --lint error message improvements. I'll do a follow-up PR that adds exports to the deno.json
2023-11-10chore: use internal namespace in 40_testing.js (#21141)Divy Srivastava
Towards #21136 - [x] assign serializePermissions, setTimeout and setExitHandler APIs to internal namespace - [x] remove usage of assert
2023-11-10fix(test) reduce queue persistence test time from 60 secs to 6 secs (#21142)Igor Zinkovsky
This PR reduces the time to run `queue persistence with inflight messages` test from 60 seconds down to about 6 seconds. The test simulates a crash to ensure that inflight messages are cleaned up and re-queued when the new process starts. Since messages are considered dead after 5 seconds of being queued, reopening the db within 5 seconds does not re-queue the messages on startup (they do get re-queued after 60 seconds, which is the cleanup frequency). By waiting for 5 seconds before reopening the db, the test ensures that the cleanup happens quickly when the db is opened.
2023-11-10fix(node/child_process): properly normalize stdio for 'spawnSync' (#21103)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/20782
2023-11-09perf: remove knowledge of promise IDs from deno (#21132)Matt Mastracci
We can move all promise ID knowledge to deno_core, allowing us to better experiment with promise implementation in deno_core. `{un,}refOpPromise(promise)` is equivalent to `{un,}refOp(promise[promiseIdSymbol])`
2023-11-09fix(node): implement createPrivateKey (#20981)Divy Srivastava
Towards #18455
2023-11-08chore: refactor test_server and move to rustls-tokio-stream (#21117)Matt Mastracci
Remove tokio-rustls as a direct dependency of Deno and refactor test_server to reduce code duplication. All tcp and tls listener paths go through the same streams now, with the exception of the simpler Hyper http-only handlers (those can be done in a later follow-up). Minor bugs fixed: - gRPC server should only serve h2 - WebSocket over http/2 had a port overlap - Restored missing eye-catchers for some servers (still missing on Hyper ones)
2023-11-07fix(ext/http): Throwing Error if the return value of Deno.serve handler is ↵Aravind
not a Response class (#21099) --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-11-07fix(node): cjs export analysis should probe for json files (#21113)David Sherret
Closes #21064
2023-11-07fix(node): inspect ancestor directories when resolving cjs re-exports during ↵David Sherret
analysis (#21104) If a CJS re-export can't be resolved, it will check the ancestor directories, which is more similar to what `require` does at runtime.
2023-11-07fix(node/http): socket.setTimeout (#20930)Gasman
Fixes #20923
2023-11-06fix(ext): use `String#toWellFormed` in ext/webidl and ext/node (#21054)Kenta Moriuchi
Fixes #18802 This PR adds `util.toUSVString` to node:util: ```js import util from "node:util"; util.toUSVString("string\ud801"); // => "string\ufffd" ```
2023-11-06fix(byonm): correct resolution for scoped packages (#21083)David Sherret
2023-11-05chore: migrate to new deno_core and metrics (#21057)Matt Mastracci
- Uses the new OpMetrics system for sync and async calls - Partial revert of #21048 as we moved Array.fromAsync upstream to deno_core
2023-11-04fix(node): use closest package.json to resolve package.json imports (#21075)David Sherret
2023-11-04fix(doc): `deno doc --lint mod.ts` should output how many files checked (#21084)David Sherret
As pointed out in https://github.com/denoland/deno/issues/21067 , it's confusing that `deno doc --lint mod.ts` outputs the documentation to stdout on success. Instead, it would be better if it outputted how many files were checked similar to what `deno lint` does on success. It still outputs the documentation if `--lint` or `--html` are provided so this is non-breaking.
2023-11-02feat(ext/kv): increase checks limit (#21055)Igor Zinkovsky
2023-11-01fix: add missing `Object.groupBy()` and `Map.groupBy()` types (#21050)Asher Gomez
2023-11-01fix(repl): jsxImportSource was not working (#21049)David Sherret
I made some fixes in deno_ast to make this possible and we forgot to update this.
2023-11-01feat: enable Array.fromAsync (#21048)Bartek Iwańczuk
2023-11-01feat: granular --unstable-* flags (#20968)Bartek Iwańczuk
This commit adds granular `--unstable-*` flags: - "--unstable-broadcast-channel" - "--unstable-ffi" - "--unstable-fs" - "--unstable-http" - "--unstable-kv" - "--unstable-net" - "--unstable-worker-options" - "--unstable-cron" These flags are meant to replace a "catch-all" flag - "--unstable", that gives a binary control whether unstable features are enabled or not. The downside of this flag that allowing eg. Deno KV API also enables the FFI API (though the latter is still gated with a permission). These flags can also be specified in `deno.json` file under `unstable` key. Currently, "--unstable" flag works the same way - I will open a follow up PR that will print a warning when using "--unstable" and suggest to use concrete "--unstable-*" flag instead. We plan to phase out "--unstable" completely in Deno 2.
2023-11-01feat(ext/websocket): websockets over http2 (#21040)Matt Mastracci
Implements `WebSocket` over http/2. This requires a conformant http/2 server supporting the extended connect protocol. Passes approximately 100 new WPT tests (mostly `?wpt_flags=h2` versions of existing websockets APIs). This is implemented as a fallback when http/1.1 fails, so a server that supports both h1 and h2 WebSockets will still end up on the http/1.1 upgrade path. The patch also cleas up the websockets handshake to split it up into http, https+http1 and https+http2, making it a little less intertwined. This uncovered a likely bug in the WPT test server: https://github.com/web-platform-tests/wpt/issues/42896
2023-11-01feat: precompile JSX (#20962)Bartek Iwańczuk
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2023-11-01fix(test): --junit-path should handle when the dir doesn't exist (#21044)David Sherret
Closes https://github.com/denoland/deno/issues/21022
2023-11-01feat: disposable Deno resources (#20845)Luca Casonato
This commit implements Symbol.dispose and Symbol.asyncDispose for the relevant resources. Closes #20839 --------- Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-11-01chore: upgrade deno_core (#21036)Bartek Iwańczuk
Updated to deno_core 0.224.0 and V8 12.0. --------- Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
2023-11-01feat(cron) implement Deno.cron() (#21019)Igor Zinkovsky
This PR adds unstable `Deno.cron` API to trigger execution of cron jobs. * State: All cron state is in memory. Cron jobs are scheduled according to the cron schedule expression and the current time. No state is persisted to disk. * Time zone: Cron expressions specify time in UTC. * Overlapping executions: not permitted. If the next scheduled execution time occurs while the same cron job is still executing, the scheduled execution is skipped. * Retries: failed jobs are automatically retried until they succeed or until retry threshold is reached. Retry policy can be optionally specified using `options.backoffSchedule`.
2023-11-01Revert "chore: use kqueue backend of notify on macOS" (#21039)Divy Srivastava
Reverts denoland/deno#21028 Reason: https://github.com/notify-rs/notify/blob/main/notify/src/kqueue.rs#L79-L81 Need to wait for the watcher thread to spawn otherwise we hit flakes --------- Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-11-01feat: deno doc --html (#21015)Bartek Iwańczuk
This commit adds static documentation site generate to "deno doc" subcommand. Example: ``` $ deno doc --html --name="My library" ./mod.ts # outputs to ./docs/ $ deno doc --html --name="My library" --output=./documentation/ ./mod.ts ./file2.js # outputs to ./documentation/ $ deno doc --html --name="My library" ./**/mod.ts # generate docs for all files with "mod.ts" name ``` Closes https://github.com/denoland/deno/issues/8233
2023-11-01feat(unstable): `deno run --env` (#20300)Asher Gomez
This change adds the `--env=[FILE]` flag to the `run`, `compile`, `eval`, `install` and `repl` subcommands. Environment variables set in the CLI overwrite those defined in the `.env` file.
2023-11-01fix(repl): support transforming JSX/TSX (#20695)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/16771 --------- Co-authored-by: David Sherret <dsherret@gmail.com> Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2023-11-01feat(doc): improve non-exported diagnostic (#21033)David Sherret
This will now catch way more scenarios.
2023-11-01fix(ext/node): adapt dynamic type checking to Node.js behavior (#21014)Kenta Moriuchi
2023-10-31feat: `deno doc --lint` (#21032)David Sherret
Adds a new `--lint` flag to `deno doc` that surfaces three kinds of diagnostics: 1. Diagnostic for non-exported type referenced in an exported type. * Why? People often forget to export types from a module in TypeScript. To supress this diagnostic, add an `@internal` jsdoc tag to the internal type. 1. Diagnostic for missing return type or missing property type on a **public** type. * Why? Otherwise `deno doc` will not display good documentation. Adding explicit types also helps with type checking performance. 1. Diagnostic for missing jsdoc on a **public** type. * Why? Everything should be documented. This diagnostic can be supressed by adding a jsdoc comment description. If the lint passes, `deno doc` generates documentation as usual. For example, checking for deno doc diagnostics on the CI: ```shellsession $ deno doc --lint mod.ts second_entrypoint.ts > /dev/null ``` This feature is incredibly useful for library authors. ## Why not include this in `deno lint`? 1. The command needs the documenation output in order to figure out the diagnostics. 1. `deno lint` doesn't understand where the entrypoints are. That's critical for the diagnostics to be useful. 1. It's much more performant to do this while generating documentation. 1. There is precedence in rustdoc (ex. `#![warn(missing_docs)]`). ## Why not `--check`? It is confusing with `deno run --check`, since that means to run type checking (and confusing with `deno check --docs`). ## Output Future Improvement The output is not ideal atm, but it's fine for a first pass. We will improve it in the future. Closes https://github.com/denoland/deno_lint/pull/972 Closes https://github.com/denoland/deno_lint/issues/970 Closes https://github.com/denoland/deno/issues/19356
2023-10-31chore: update macOS shared library test (#21031)Divy Srivastava
2023-10-31feat(ext/web): EventSource (#14730)Leo Kettmeir
Closes #10298 --------- Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
2023-10-31chore: use kqueue backend of notify on macOS (#21028)Divy Srivastava
Towards #20996 "macos_fsevent" feature of notify links us to CoreFoundation on macOS.